Made 2 tests compile without cxx11.

HdG: --
This commit is contained in:
Benoit Steiner 2015-12-10 23:20:04 -08:00
parent 8d28a161b2
commit 2d8f2e4042
2 changed files with 14 additions and 6 deletions

View File

@ -24,12 +24,12 @@ static void test_simple_cast()
cplextensor.setRandom();
chartensor = ftensor.cast<char>();
cplextensor = ftensor.cast<std::complex<float>>();
cplextensor = ftensor.cast<std::complex<float> >();
for (int i = 0; i < 20; ++i) {
for (int j = 0; j < 30; ++j) {
VERIFY_IS_EQUAL(chartensor(i,j), static_cast<char>(ftensor(i,j)));
VERIFY_IS_EQUAL(cplextensor(i,j), static_cast<std::complex<float>>(ftensor(i,j)));
VERIFY_IS_EQUAL(cplextensor(i,j), static_cast<std::complex<float> >(ftensor(i,j)));
}
}
}

View File

@ -114,10 +114,18 @@ static void test_expr_reverse(bool LValue)
Tensor<float, 4, DataLayout> result(2,3,5,7);
array<ptrdiff_t, 4> src_slice_dim{{2,3,1,7}};
array<ptrdiff_t, 4> src_slice_start{{0,0,0,0}};
array<ptrdiff_t, 4> dst_slice_dim{{2,3,1,7}};
array<ptrdiff_t, 4> dst_slice_start{{0,0,0,0}};
array<ptrdiff_t, 4> src_slice_dim;
src_slice_dim[0] = 2;
src_slice_dim[1] = 3;
src_slice_dim[2] = 1;
src_slice_dim[3] = 7;
array<ptrdiff_t, 4> src_slice_start;
src_slice_start[0] = 0;
src_slice_start[1] = 0;
src_slice_start[2] = 0;
src_slice_start[3] = 0;
array<ptrdiff_t, 4> dst_slice_dim = src_slice_dim;
array<ptrdiff_t, 4> dst_slice_start = src_slice_start;
for (int i = 0; i < 5; ++i) {
if (LValue) {