mirror of
https://github.com/boostorg/multi_array.git
synced 2025-05-11 05:13:53 +00:00
Merge pull request #22 from boostorg/lightweight_test
Switch to Boost.Lightweight_Test for faster test build and run times
This commit is contained in:
commit
56b9b62ce4
@ -4,48 +4,47 @@
|
||||
# "as is" without express or implied warranty, and with no claim as
|
||||
# to its suitability for any purpose.
|
||||
|
||||
test-suite multi_array
|
||||
:
|
||||
[ compile-fail fail_cbracket.cpp ]
|
||||
[ compile-fail fail_cdata.cpp ]
|
||||
[ compile-fail fail_citerator.cpp ]
|
||||
[ compile-fail fail_cparen.cpp ]
|
||||
[ compile-fail fail_criterator.cpp ]
|
||||
[ compile-fail fail_csubarray.cpp ]
|
||||
[ compile-fail fail_csubarray2.cpp ]
|
||||
[ compile-fail fail_csubarray3.cpp ]
|
||||
[ compile-fail fail_cview.cpp ]
|
||||
[ compile-fail fail_cview2.cpp ]
|
||||
[ compile-fail fail_cview3.cpp ]
|
||||
[ compile-fail fail_ref_cbracket.cpp ]
|
||||
[ compile-fail fail_ref_cdata.cpp ]
|
||||
[ compile-fail fail_ref_citerator.cpp ]
|
||||
[ compile-fail fail_ref_cparen.cpp ]
|
||||
[ compile-fail fail_ref_criterator.cpp ]
|
||||
[ compile-fail fail_ref_csubarray.cpp ]
|
||||
[ compile-fail fail_ref_csubarray2.cpp ]
|
||||
[ compile-fail fail_ref_csubarray3.cpp ]
|
||||
[ compile-fail fail_ref_cview.cpp ]
|
||||
[ compile-fail fail_ref_cview2.cpp ]
|
||||
[ compile-fail fail_ref_cview3.cpp ]
|
||||
|
||||
[ run constructors.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run access.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run compare.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run iterators.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run slice.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run assign.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run assign_to_array.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run index_bases.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run storage_order_convert.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run storage_order.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run reshape.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run range1.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run idxgen1.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run stl_interaction.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run resize.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run assert.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
[ run reverse_view.cpp ../../test/build//boost_test_exec_monitor ]
|
||||
import testing ;
|
||||
|
||||
[ compile concept_checks.cpp ]
|
||||
;
|
||||
compile-fail fail_cbracket.cpp ;
|
||||
compile-fail fail_cdata.cpp ;
|
||||
compile-fail fail_citerator.cpp ;
|
||||
compile-fail fail_cparen.cpp ;
|
||||
compile-fail fail_criterator.cpp ;
|
||||
compile-fail fail_csubarray.cpp ;
|
||||
compile-fail fail_csubarray2.cpp ;
|
||||
compile-fail fail_csubarray3.cpp ;
|
||||
compile-fail fail_cview.cpp ;
|
||||
compile-fail fail_cview2.cpp ;
|
||||
compile-fail fail_cview3.cpp ;
|
||||
compile-fail fail_ref_cbracket.cpp ;
|
||||
compile-fail fail_ref_cdata.cpp ;
|
||||
compile-fail fail_ref_citerator.cpp ;
|
||||
compile-fail fail_ref_cparen.cpp ;
|
||||
compile-fail fail_ref_criterator.cpp ;
|
||||
compile-fail fail_ref_csubarray.cpp ;
|
||||
compile-fail fail_ref_csubarray2.cpp ;
|
||||
compile-fail fail_ref_csubarray3.cpp ;
|
||||
compile-fail fail_ref_cview.cpp ;
|
||||
compile-fail fail_ref_cview2.cpp ;
|
||||
compile-fail fail_ref_cview3.cpp ;
|
||||
|
||||
run constructors.cpp ;
|
||||
run access.cpp ;
|
||||
run compare.cpp ;
|
||||
run iterators.cpp ;
|
||||
run slice.cpp ;
|
||||
run assign.cpp ;
|
||||
run assign_to_array.cpp ;
|
||||
run index_bases.cpp ;
|
||||
run storage_order_convert.cpp ;
|
||||
run storage_order.cpp ;
|
||||
run reshape.cpp ;
|
||||
run range1.cpp ;
|
||||
run idxgen1.cpp ;
|
||||
run stl_interaction.cpp ;
|
||||
run resize.cpp ;
|
||||
run assert.cpp ;
|
||||
run reverse_view.cpp ;
|
||||
|
||||
compile concept_checks.cpp ;
|
||||
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
|
||||
#include "generative_tests.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
template <typename Array>
|
||||
void access(Array& A, const mutable_array_tag&) {
|
||||
@ -42,8 +42,8 @@ void access(Array& A, const const_array_tag&) {
|
||||
for (index i = idx0; i != idx0+2; ++i)
|
||||
for (index j = idx1; j != idx1+3; ++j)
|
||||
for (index k = idx2; k != idx2+4; ++k) {
|
||||
BOOST_CHECK(A[i][j][k] == cnum++);
|
||||
BOOST_CHECK(CA[i][j][k] == A[i][j][k]);
|
||||
BOOST_TEST(A[i][j][k] == cnum++);
|
||||
BOOST_TEST(CA[i][j][k] == A[i][j][k]);
|
||||
}
|
||||
|
||||
// operator()
|
||||
@ -52,12 +52,12 @@ void access(Array& A, const const_array_tag&) {
|
||||
for (index k2 = idx2; k2 != idx2+4; ++k2) {
|
||||
boost::array<index,ndims> indices;
|
||||
indices[0] = i2; indices[1] = j2; indices[2] = k2;
|
||||
BOOST_CHECK(A(indices) == A[i2][j2][k2]);
|
||||
BOOST_CHECK(CA(indices) == A(indices));
|
||||
BOOST_TEST(A(indices) == A[i2][j2][k2]);
|
||||
BOOST_TEST(CA(indices) == A(indices));
|
||||
}
|
||||
++tests_run;
|
||||
}
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
return run_generative_tests();
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
// with exceptions
|
||||
//
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define BOOST_ENABLE_ASSERT_HANDLER
|
||||
#include "boost/multi_array.hpp" // includes assert.hpp
|
||||
#include <boost/multi_array.hpp> // includes assert.hpp
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
@ -40,7 +40,7 @@ namespace boost {
|
||||
using namespace boost;
|
||||
|
||||
int
|
||||
test_main(int,char*[]) {
|
||||
main() {
|
||||
|
||||
typedef multi_array<int,2> array_t;
|
||||
|
||||
@ -55,5 +55,5 @@ test_main(int,char*[]) {
|
||||
//...all good
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,9 +15,9 @@
|
||||
//
|
||||
//
|
||||
#include "generative_tests.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/multi_array.hpp"
|
||||
#include "boost/cstdlib.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <boost/cstdlib.hpp>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
@ -59,7 +59,7 @@ void access(Array& A, const mutable_array_tag&) {
|
||||
|
||||
A = filler;
|
||||
|
||||
BOOST_CHECK(::equal(A,filler));
|
||||
BOOST_TEST(::equal(A,filler));
|
||||
++tests_run;
|
||||
}
|
||||
|
||||
@ -68,6 +68,6 @@ void access(Array&, const const_array_tag&) {
|
||||
}
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
return run_generative_tests();
|
||||
}
|
||||
|
@ -16,9 +16,9 @@
|
||||
//
|
||||
//
|
||||
#include "generative_tests.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/multi_array.hpp"
|
||||
#include "boost/cstdlib.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <boost/cstdlib.hpp>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
@ -50,11 +50,11 @@ template <typename Array>
|
||||
void access(Array& A, const const_array_tag&) {
|
||||
typedef boost::multi_array<int,3> array3;
|
||||
array3 acopy(A);
|
||||
BOOST_CHECK(::equal(acopy,A));
|
||||
BOOST_TEST(::equal(acopy,A));
|
||||
++tests_run;
|
||||
}
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
return run_generative_tests();
|
||||
}
|
||||
|
@ -12,16 +12,16 @@
|
||||
|
||||
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
|
||||
|
||||
int
|
||||
test_main(int, char*[])
|
||||
main()
|
||||
{
|
||||
typedef boost::multi_array<double, 3> array;
|
||||
typedef array::size_type size_type;
|
||||
@ -34,9 +34,9 @@ test_main(int, char*[])
|
||||
std::vector<double> vals(num_elements, 4.5);
|
||||
A.assign(vals.begin(),vals.end());
|
||||
array B(A);
|
||||
BOOST_CHECK(A == B);
|
||||
BOOST_CHECK(B == A);
|
||||
BOOST_CHECK(A[0] == B[0]);
|
||||
BOOST_TEST(A == B);
|
||||
BOOST_TEST(B == A);
|
||||
BOOST_TEST(A[0] == B[0]);
|
||||
}
|
||||
// Assignment Operator
|
||||
{
|
||||
@ -44,15 +44,15 @@ test_main(int, char*[])
|
||||
std::vector<double> vals(num_elements, 4.5);
|
||||
A.assign(vals.begin(),vals.end());
|
||||
B = A;
|
||||
BOOST_CHECK(A == B);
|
||||
BOOST_CHECK(B == A);
|
||||
BOOST_CHECK(B[0] == A[0]);
|
||||
BOOST_TEST(A == B);
|
||||
BOOST_TEST(B == A);
|
||||
BOOST_TEST(B[0] == A[0]);
|
||||
|
||||
typedef array::index_range range;
|
||||
array::index_gen indices;
|
||||
array::array_view<2>::type C = A[indices[2][range()][range()]];
|
||||
array::array_view<2>::type D = B[indices[2][range()][range()]];
|
||||
BOOST_CHECK(C == D);
|
||||
BOOST_TEST(C == D);
|
||||
}
|
||||
// Different Arrays
|
||||
{
|
||||
@ -62,15 +62,15 @@ test_main(int, char*[])
|
||||
A.assign(valsA.begin(),valsA.end());
|
||||
B.assign(valsB.begin(),valsB.end());
|
||||
|
||||
BOOST_CHECK(A != B);
|
||||
BOOST_CHECK(B != A);
|
||||
BOOST_CHECK(A[0] != B[0]);
|
||||
BOOST_TEST(A != B);
|
||||
BOOST_TEST(B != A);
|
||||
BOOST_TEST(A[0] != B[0]);
|
||||
|
||||
typedef array::index_range range;
|
||||
array::index_gen indices;
|
||||
array::array_view<2>::type C = A[indices[2][range()][range()]];
|
||||
array::array_view<2>::type D = B[indices[2][range()][range()]];
|
||||
BOOST_CHECK(C != D);
|
||||
BOOST_TEST(C != D);
|
||||
}
|
||||
|
||||
// Comparisons galore!
|
||||
@ -108,35 +108,35 @@ test_main(int, char*[])
|
||||
A.assign(valsA,valsA+num_elements);
|
||||
B.assign(valsB,valsB+num_elements);
|
||||
|
||||
BOOST_CHECK(B < A);
|
||||
BOOST_CHECK(A > B);
|
||||
BOOST_TEST(B < A);
|
||||
BOOST_TEST(A > B);
|
||||
|
||||
BOOST_CHECK(B <= A);
|
||||
BOOST_CHECK(A >= B);
|
||||
BOOST_TEST(B <= A);
|
||||
BOOST_TEST(A >= B);
|
||||
|
||||
BOOST_CHECK(B[0] == A[0]);
|
||||
BOOST_CHECK(B[2] < A[2]);
|
||||
BOOST_TEST(B[0] == A[0]);
|
||||
BOOST_TEST(B[2] < A[2]);
|
||||
|
||||
array C = A;
|
||||
|
||||
BOOST_CHECK(C <= A);
|
||||
BOOST_CHECK(C >= A);
|
||||
BOOST_TEST(C <= A);
|
||||
BOOST_TEST(C >= A);
|
||||
|
||||
BOOST_CHECK(!(C < A));
|
||||
BOOST_CHECK(!(C > A));
|
||||
BOOST_TEST(!(C < A));
|
||||
BOOST_TEST(!(C > A));
|
||||
|
||||
typedef array::index_range range;
|
||||
array::index_gen indices;
|
||||
array::array_view<2>::type D = A[indices[2][range()][range()]];
|
||||
array::array_view<2>::type E = B[indices[2][range()][range()]];
|
||||
|
||||
BOOST_CHECK(E < D);
|
||||
BOOST_CHECK(E <= D);
|
||||
BOOST_TEST(E < D);
|
||||
BOOST_TEST(E <= D);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,18 +15,18 @@
|
||||
// make sure the types meet concept requirements
|
||||
//
|
||||
|
||||
#include "boost/concept_check.hpp"
|
||||
#include "boost/multi_array/concept_checks.hpp"
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/multi_array/concept_checks.hpp>
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/cstdlib.hpp"
|
||||
#include <boost/cstdlib.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
|
@ -15,9 +15,9 @@
|
||||
//
|
||||
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
|
||||
@ -30,10 +30,10 @@ void check_shape(const Array& A,
|
||||
int* strides,
|
||||
unsigned int num_elements)
|
||||
{
|
||||
BOOST_CHECK(A.num_elements() == num_elements);
|
||||
BOOST_CHECK(A.size() == *sizes);
|
||||
BOOST_CHECK(std::equal(sizes, sizes + A.num_dimensions(), A.shape()));
|
||||
BOOST_CHECK(std::equal(strides, strides + A.num_dimensions(), A.strides()));
|
||||
BOOST_TEST(A.num_elements() == num_elements);
|
||||
BOOST_TEST(A.size() == *sizes);
|
||||
BOOST_TEST(std::equal(sizes, sizes + A.num_dimensions(), A.shape()));
|
||||
BOOST_TEST(std::equal(strides, strides + A.num_dimensions(), A.strides()));
|
||||
check_shape(A[0], ++sizes, ++strides, num_elements / A.size());
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ bool equal(const ArrayA& A, const ArrayB& B)
|
||||
|
||||
|
||||
int
|
||||
test_main(int, char*[])
|
||||
main()
|
||||
{
|
||||
typedef boost::multi_array<double, 3>::size_type size_type;
|
||||
boost::array<size_type,3> sizes = { { 3, 3, 3 } };
|
||||
@ -132,20 +132,20 @@ test_main(int, char*[])
|
||||
A.assign(vals.begin(),vals.end());
|
||||
boost::multi_array<double, 3> B(A);
|
||||
check_shape(B, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(::equal(A, B));
|
||||
BOOST_TEST(::equal(A, B));
|
||||
|
||||
double ptr[27];
|
||||
boost::multi_array_ref<double, 3> C(ptr,sizes);
|
||||
A.assign(vals.begin(),vals.end());
|
||||
boost::multi_array_ref<double, 3> D(C);
|
||||
check_shape(D, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(C.data() == D.data());
|
||||
BOOST_TEST(C.data() == D.data());
|
||||
|
||||
const double* cptr = ptr;
|
||||
boost::const_multi_array_ref<double, 3> E(cptr,sizes);
|
||||
boost::const_multi_array_ref<double, 3> F(E);
|
||||
check_shape(F, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(E.data() == F.data());
|
||||
BOOST_TEST(E.data() == F.data());
|
||||
}
|
||||
|
||||
|
||||
@ -161,15 +161,15 @@ test_main(int, char*[])
|
||||
boost::const_multi_array_ref<double, 3> C(A);
|
||||
check_shape(B, &sizes[0], strides, num_elements);
|
||||
check_shape(C, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(B.data() == A.data());
|
||||
BOOST_CHECK(C.data() == A.data());
|
||||
BOOST_TEST(B.data() == A.data());
|
||||
BOOST_TEST(C.data() == A.data());
|
||||
|
||||
double ptr[27];
|
||||
boost::multi_array_ref<double, 3> D(ptr,sizes);
|
||||
D.assign(vals.begin(),vals.end());
|
||||
boost::const_multi_array_ref<double, 3> E(D);
|
||||
check_shape(E, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(E.data() == D.data());
|
||||
BOOST_TEST(E.data() == D.data());
|
||||
}
|
||||
|
||||
// Assignment Operator
|
||||
@ -182,7 +182,7 @@ test_main(int, char*[])
|
||||
A.assign(vals.begin(),vals.end());
|
||||
B = A;
|
||||
check_shape(B, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(::equal(A, B));
|
||||
BOOST_TEST(::equal(A, B));
|
||||
|
||||
double ptr1[27];
|
||||
double ptr2[27];
|
||||
@ -190,7 +190,7 @@ test_main(int, char*[])
|
||||
C.assign(vals.begin(),vals.end());
|
||||
D = C;
|
||||
check_shape(D, &sizes[0], strides, num_elements);
|
||||
BOOST_CHECK(::equal(C,D));
|
||||
BOOST_TEST(::equal(C,D));
|
||||
}
|
||||
|
||||
|
||||
@ -209,10 +209,10 @@ test_main(int, char*[])
|
||||
subarray::value_type C = B[0];
|
||||
|
||||
// should comparisons between the types work?
|
||||
BOOST_CHECK(::equal(A[1][0],C));
|
||||
BOOST_CHECK(::equal(B[0],C));
|
||||
BOOST_TEST(::equal(A[1][0],C));
|
||||
BOOST_TEST(::equal(B[0],C));
|
||||
}
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
//
|
||||
// Trying to diagnose problems under visual
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/limits.hpp"
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
|
@ -15,14 +15,14 @@
|
||||
// checking constness of const operator[].
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -36,5 +36,5 @@ test_main(int,char*[])
|
||||
// FAIL! cannot assign to csma.
|
||||
csma[0][0][0] = 5;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing data() member function constness.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -37,5 +37,5 @@ test_main(int,char*[])
|
||||
|
||||
// FAIL! data() returns a const int*
|
||||
*csma.data() = 0;
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
// const_iterator/iterator conversion test
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
typedef boost::multi_array<int,3> array;
|
||||
|
||||
typedef array::iterator iterator1;
|
||||
@ -29,5 +29,5 @@ int test_main(int,char*[]) {
|
||||
// ILLEGAL conversion from const_iterator to iterator
|
||||
iterator1 in = citerator1();
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing const operator() constness.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -40,5 +40,5 @@ test_main(int,char*[])
|
||||
// FAIL! Cannot assign to csma
|
||||
csma(indices) = 5;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
// const_reverse_iterator/reverse_iterator conversion test
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
typedef boost::multi_array<int,3> array;
|
||||
|
||||
typedef array::reverse_iterator riterator1;
|
||||
@ -29,5 +29,5 @@ int test_main(int,char*[]) {
|
||||
// ILLEGAL conversion from const_reverse_iterator to reverse_iterator
|
||||
riterator1 in = criterator1();
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing subarray and const_subarray assignment
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -42,5 +42,5 @@ test_main(int,char*[])
|
||||
// FAIL! Preserve constness (no const_subarray -> subarray conversion).
|
||||
array::subarray<ndims-1>::type sba = csba;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing constness of subarray operations.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -41,5 +41,5 @@ test_main(int,char*[])
|
||||
// FAIL! preserve constness.
|
||||
array::subarray<ndims-1>::type sba = sma_const[0];
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing constness of subarray operations.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -45,5 +45,5 @@ test_main(int,char*[])
|
||||
// FAIL! sba cannot be assigned to.
|
||||
sba[j][k] = num++;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,15 +15,15 @@
|
||||
// ensure const_array_view doesn't allow element assignment.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -54,7 +54,7 @@ test_main(int,char*[])
|
||||
// FAIL! const_array_view cannot be assigned to.
|
||||
csma2(elmt) = 5;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,17 +15,17 @@
|
||||
// ensure const_array_view cannot be converted to array_view
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include "boost/test/test_tools.hpp"
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include "boost/cstdlib.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/cstdlib.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -52,7 +52,7 @@ test_main(int,char*[])
|
||||
array::array_view<ndims>::type csma2 =
|
||||
csma[indices[range(0,2)][range(1,3)][range(0,4,2)]];
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,15 +15,15 @@
|
||||
// ensure const_array_ref doesn't allow assignment.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -55,7 +55,7 @@ test_main(int,char*[])
|
||||
// FAIL! csma2 cannot be assigned to.
|
||||
csma2[i][j][k] = 0;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,14 +15,14 @@
|
||||
// checking constness of const operator[].
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -40,5 +40,5 @@ test_main(int,char*[])
|
||||
// FAIL! can't assign to const multi_array_ref.
|
||||
csma[0][0][0] = 5;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing data() member function constness.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -36,5 +36,5 @@ test_main(int,char*[])
|
||||
|
||||
// FAIL! data() returns const int*.
|
||||
*csma.data() = 0;
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
// const_iterator/iterator conversion test
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
typedef boost::multi_array_ref<int,3> array_ref;
|
||||
|
||||
typedef array_ref::iterator iterator1;
|
||||
@ -29,5 +29,5 @@ int test_main(int,char*[]) {
|
||||
// FAIL! ILLEGAL conversion from const_iterator to iterator
|
||||
iterator1 in = citerator1();
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing const operator() constness.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -40,5 +40,5 @@ test_main(int,char*[])
|
||||
// FAIL! cannot assign to a const multi_array_ref
|
||||
csma(indices) = 5;
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
// const_reverse_iterator/reverse_iterator conversion test
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
typedef boost::multi_array_ref<int,3> array_ref;
|
||||
|
||||
typedef array_ref::reverse_iterator riterator1;
|
||||
@ -29,5 +29,5 @@ int test_main(int,char*[]) {
|
||||
// Fail! ILLEGAL conversion from const_reverse_iterator to reverse_iterator
|
||||
riterator1 in = criterator1();
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing subarray and const_subarray assignment
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -44,5 +44,5 @@ test_main(int,char*[])
|
||||
|
||||
array_ref::subarray<ndims-1>::type sba = csba; // FAIL! preserve constness.
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing constness of subarray operations.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -45,5 +45,5 @@ test_main(int,char*[])
|
||||
array_ref::subarray<ndims-1>::type sba = sma_const[0]; // FAIL!
|
||||
// preserve constness
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
// Testing constness of subarray operations.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -48,5 +48,5 @@ test_main(int,char*[])
|
||||
for (array_ref::index k = 0; k != 4; ++k)
|
||||
sba[j][k] = num++; // FAIL! can't assign to const_subarray.
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,15 +15,15 @@
|
||||
// ensure const_array_view doesn't allow element assignment.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -51,7 +51,7 @@ test_main(int,char*[])
|
||||
|
||||
csma2(elmt) = 5; // FAIL! csma is read only
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,15 +15,15 @@
|
||||
// ensure const_array_view cannot be converted to array_view
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -52,7 +52,7 @@ test_main(int,char*[])
|
||||
for (array_ref::index k = 0; k != 2; ++k)
|
||||
csma2[i][j][k] = 0; // FAIL! csma2 is read only
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,15 +15,15 @@
|
||||
// ensure const_array_view doesn't allow assignment.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array_ref<int,ndims> array_ref;
|
||||
@ -53,7 +53,7 @@ test_main(int,char*[])
|
||||
for (array_ref::index k = 0; k != 2; ++k)
|
||||
csma2[i][j][k] = 0; // FAIL! csma2 is read only.
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,9 +45,9 @@
|
||||
//
|
||||
// int test_main(int,char*[]) { return run_generative_tests(); }
|
||||
//
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <boost/config.hpp> /* BOOST_NO_SFINAE */
|
||||
#include <algorithm>
|
||||
@ -100,7 +100,7 @@ template <typename Array>
|
||||
void access(Array& A, const const_array_tag&);
|
||||
|
||||
template <typename StorageOrder3,typename StorageOrder4,typename Modifier>
|
||||
int run_configuration(const StorageOrder3& so3,
|
||||
void run_configuration(const StorageOrder3& so3,
|
||||
const StorageOrder4& so4,
|
||||
const Modifier& modifier) {
|
||||
// multi_array
|
||||
@ -213,11 +213,10 @@ int run_configuration(const StorageOrder3& so3,
|
||||
access(C,const_array_tag());
|
||||
}
|
||||
}
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
template <typename ArrayModifier>
|
||||
int run_storage_tests(const ArrayModifier& modifier) {
|
||||
void run_storage_tests(const ArrayModifier& modifier) {
|
||||
run_configuration(boost::c_storage_order(),
|
||||
boost::c_storage_order(),modifier);
|
||||
run_configuration(boost::fortran_storage_order(),
|
||||
@ -228,8 +227,6 @@ int run_storage_tests(const ArrayModifier& modifier) {
|
||||
run_configuration(boost::general_storage_order<3>(ordering,ascending),
|
||||
boost::general_storage_order<4>(ordering,ascending),
|
||||
modifier);
|
||||
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
struct null_modifier {
|
||||
@ -279,7 +276,7 @@ int run_generative_tests() {
|
||||
run_storage_tests(reindex_modifier());
|
||||
run_storage_tests(reshape_modifier());
|
||||
std::cout << "Total Tests Run: " << tests_run << '\n';
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif // GENERATIVE_TESTS_RG072001_HPP
|
||||
|
@ -14,12 +14,12 @@
|
||||
// idxset1.cpp - testing the code for index_gen
|
||||
//
|
||||
|
||||
#include "boost/multi_array/index_gen.hpp"
|
||||
#include "boost/multi_array/index_range.hpp"
|
||||
#include "boost/multi_array/types.hpp"
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/multi_array/index_gen.hpp>
|
||||
#include <boost/multi_array/index_range.hpp>
|
||||
#include <boost/multi_array/types.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
typedef boost::detail::multi_array::index index_type;
|
||||
typedef boost::detail::multi_array::size_type size_type;
|
||||
@ -37,7 +37,7 @@ bool operator==(const range& lhs,const range& rhs) {
|
||||
}
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
|
||||
boost::detail::multi_array::index_gen<0,0> indices;
|
||||
@ -62,20 +62,20 @@ test_main(int,char*[])
|
||||
{
|
||||
boost::detail::multi_array::index_gen<3,3> is1 =
|
||||
indices[range(0,1,2)][range(1,2,3)][range(2,3,4)];
|
||||
BOOST_CHECK(is1.ranges_[0] == range(0,1,2));
|
||||
BOOST_CHECK(is1.ranges_[1] == range(1,2,3));
|
||||
BOOST_CHECK(is1.ranges_[2] == range(2,3,4));
|
||||
BOOST_TEST(is1.ranges_[0] == range(0,1,2));
|
||||
BOOST_TEST(is1.ranges_[1] == range(1,2,3));
|
||||
BOOST_TEST(is1.ranges_[2] == range(2,3,4));
|
||||
}
|
||||
|
||||
{
|
||||
boost::detail::multi_array::index_gen<3,2> is2 =
|
||||
indices[range(0,1,2)][2][range(2,3,4)];
|
||||
BOOST_CHECK(is2.ranges_[0] == range(0,1,2));
|
||||
BOOST_CHECK(is2.ranges_[1] == range(2));
|
||||
BOOST_CHECK(is2.ranges_[1].is_degenerate());
|
||||
BOOST_CHECK(is2.ranges_[2] == range(2,3,4));
|
||||
BOOST_TEST(is2.ranges_[0] == range(0,1,2));
|
||||
BOOST_TEST(is2.ranges_[1] == range(2));
|
||||
BOOST_TEST(is2.ranges_[1].is_degenerate());
|
||||
BOOST_TEST(is2.ranges_[2] == range(2,3,4));
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -14,15 +14,15 @@
|
||||
// index_bases - test of the index_base modifying facilities.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
typedef boost::multi_array<double, 3> array;
|
||||
typedef boost::multi_array_ref<double, 3> array_ref;
|
||||
@ -63,11 +63,11 @@ test_main(int,char*[])
|
||||
for (size_type a = 0; a < A.shape()[0]; ++a)
|
||||
for (size_type b = 0; b < A.shape()[1]; ++b)
|
||||
for (size_type c = 0; c < A.shape()[2]; ++c) {
|
||||
BOOST_CHECK(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_CHECK(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_CHECK(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
// Test that E does not inherit A's index_base
|
||||
BOOST_CHECK(E[a][b][c] == B[a][b][c]);
|
||||
BOOST_TEST(E[a][b][c] == B[a][b][c]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,10 +100,10 @@ test_main(int,char*[])
|
||||
for (size_type a = 0; a < A.shape()[0]; ++a)
|
||||
for (size_type b = 0; b < A.shape()[1]; ++b)
|
||||
for (size_type c = 0; c < A.shape()[2]; ++c) {
|
||||
BOOST_CHECK(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_CHECK(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_CHECK(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_CHECK(E[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
BOOST_TEST(E[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,12 +142,12 @@ test_main(int,char*[])
|
||||
for (size_type a = 0; a < A.shape()[0]; ++a)
|
||||
for (size_type b = 0; b < A.shape()[1]; ++b)
|
||||
for (size_type c = 0; c < A.shape()[2]; ++c) {
|
||||
BOOST_CHECK(A[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_CHECK(C[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_CHECK(D[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_CHECK(E[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_TEST(A[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_TEST(C[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_TEST(D[a+1][b+1][c+1] == B[a][b][c]);
|
||||
BOOST_TEST(E[a+1][b+1][c+1] == B[a][b][c]);
|
||||
}
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
#define MULTIARRAY_TEST_ASSIGN
|
||||
#include "generative_tests.hpp"
|
||||
#include "boost/concept_check.hpp" // for ignore_unused_variable_warning
|
||||
#include "boost/mpl/if.hpp"
|
||||
#include "boost/type_traits/is_same.hpp"
|
||||
#include <boost/concept_check.hpp> // for ignore_unused_variable_warning
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
// iterator-test-specific code
|
||||
|
||||
@ -107,8 +107,8 @@ void test_iterators(Array& A, const IterTraits&) {
|
||||
typedef typename IterTraits::iterator3 iterator;
|
||||
iterator i1 = A.begin();
|
||||
iterator i2 = A.end();
|
||||
BOOST_CHECK(i1 < i2);
|
||||
BOOST_CHECK((i2 - i1) == typename iterator::difference_type(2));
|
||||
BOOST_TEST(i1 < i2);
|
||||
BOOST_TEST((i2 - i1) == typename iterator::difference_type(2));
|
||||
}
|
||||
|
||||
// Standard Array Iteration
|
||||
@ -121,7 +121,7 @@ void test_iterators(Array& A, const IterTraits&) {
|
||||
for (iterator3 i = A.begin(); i != A.end(); ++i)
|
||||
for(iterator2 ii = (*i).begin(); ii != (*i).end(); ++ii)
|
||||
for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii)
|
||||
BOOST_CHECK(*iii == vals++);
|
||||
BOOST_TEST(*iii == vals++);
|
||||
}
|
||||
|
||||
// Using operator->() on iterators
|
||||
@ -134,7 +134,7 @@ void test_iterators(Array& A, const IterTraits&) {
|
||||
for (iterator3 i = A.begin(); i != A.end(); ++i)
|
||||
for(iterator2 ii = i->begin(); ii != i->end(); ++ii)
|
||||
for(iterator1 iii = ii->begin(); iii != ii->end(); ++iii)
|
||||
BOOST_CHECK(*iii == vals++);
|
||||
BOOST_TEST(*iii == vals++);
|
||||
}
|
||||
|
||||
// Reverse Iterator Hierarchy Test
|
||||
@ -148,7 +148,7 @@ void test_iterators(Array& A, const IterTraits&) {
|
||||
for(riterator2 ii = (*i).rbegin(); ii != (riterator2)(*i).rend(); ++ii)
|
||||
for(riterator1 iii = (*ii).rbegin(); iii != (riterator1)(*ii).rend();
|
||||
++iii)
|
||||
BOOST_CHECK(*iii == check_iter_val--);
|
||||
BOOST_TEST(*iii == check_iter_val--);
|
||||
}
|
||||
++tests_run;
|
||||
}
|
||||
@ -182,7 +182,7 @@ void access(Array& A, const const_array_tag&) {
|
||||
|
||||
|
||||
int
|
||||
test_main(int, char*[])
|
||||
main()
|
||||
{
|
||||
return run_generative_tests();
|
||||
}
|
||||
|
@ -15,91 +15,91 @@
|
||||
//
|
||||
|
||||
|
||||
#include "boost/multi_array/index_range.hpp"
|
||||
#include <boost/multi_array/index_range.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
typedef boost::detail::multi_array::index_range<int,std::size_t> range;
|
||||
|
||||
{
|
||||
// typical range creation and extraction
|
||||
range r1(-3,5);
|
||||
BOOST_CHECK(r1.start() == -3);
|
||||
BOOST_CHECK(r1.finish() == 5);
|
||||
BOOST_CHECK(r1.stride() == 1);
|
||||
BOOST_CHECK(!r1.is_degenerate());
|
||||
BOOST_CHECK(r1.get_start(0) == -3);
|
||||
BOOST_CHECK(r1.get_finish(100) == 5);
|
||||
BOOST_TEST(r1.start() == -3);
|
||||
BOOST_TEST(r1.finish() == 5);
|
||||
BOOST_TEST(r1.stride() == 1);
|
||||
BOOST_TEST(!r1.is_degenerate());
|
||||
BOOST_TEST(r1.get_start(0) == -3);
|
||||
BOOST_TEST(r1.get_finish(100) == 5);
|
||||
}
|
||||
|
||||
{
|
||||
range r2(-3,5,2);
|
||||
BOOST_CHECK(r2.start() == -3);
|
||||
BOOST_CHECK(r2.finish() == 5);
|
||||
BOOST_CHECK(r2.stride() == 2);
|
||||
BOOST_CHECK(!r2.is_degenerate());
|
||||
BOOST_TEST(r2.start() == -3);
|
||||
BOOST_TEST(r2.finish() == 5);
|
||||
BOOST_TEST(r2.stride() == 2);
|
||||
BOOST_TEST(!r2.is_degenerate());
|
||||
}
|
||||
|
||||
{
|
||||
// degenerate creation
|
||||
range r3(5);
|
||||
BOOST_CHECK(r3.start() == 5);
|
||||
BOOST_CHECK(r3.finish() == 6);
|
||||
BOOST_CHECK(r3.stride() == 1);
|
||||
BOOST_CHECK(r3.is_degenerate());
|
||||
BOOST_TEST(r3.start() == 5);
|
||||
BOOST_TEST(r3.finish() == 6);
|
||||
BOOST_TEST(r3.stride() == 1);
|
||||
BOOST_TEST(r3.is_degenerate());
|
||||
}
|
||||
|
||||
{
|
||||
// default range creation
|
||||
range r4;
|
||||
BOOST_CHECK(r4.get_start(0) == 0);
|
||||
BOOST_CHECK(r4.get_finish(100) == 100);
|
||||
BOOST_CHECK(r4.stride() == 1);
|
||||
BOOST_TEST(r4.get_start(0) == 0);
|
||||
BOOST_TEST(r4.get_finish(100) == 100);
|
||||
BOOST_TEST(r4.stride() == 1);
|
||||
}
|
||||
|
||||
{
|
||||
// create a range using the setter methods
|
||||
range r5 = range().stride(2).start(-3).finish(7);
|
||||
BOOST_CHECK(r5.start() == -3);
|
||||
BOOST_CHECK(r5.stride() == 2);
|
||||
BOOST_CHECK(r5.finish() == 7);
|
||||
BOOST_TEST(r5.start() == -3);
|
||||
BOOST_TEST(r5.stride() == 2);
|
||||
BOOST_TEST(r5.finish() == 7);
|
||||
}
|
||||
|
||||
// try out all the comparison operators
|
||||
{
|
||||
range r6 = -3 <= range().stride(2) < 7;
|
||||
BOOST_CHECK(r6.start() == -3);
|
||||
BOOST_CHECK(r6.stride() == 2);
|
||||
BOOST_CHECK(r6.finish() == 7);
|
||||
BOOST_TEST(r6.start() == -3);
|
||||
BOOST_TEST(r6.stride() == 2);
|
||||
BOOST_TEST(r6.finish() == 7);
|
||||
}
|
||||
|
||||
{
|
||||
range r7 = -3 < range() <= 7;
|
||||
BOOST_CHECK(r7.start() == -2);
|
||||
BOOST_CHECK(r7.stride() == 1);
|
||||
BOOST_CHECK(r7.finish() == 8);
|
||||
BOOST_TEST(r7.start() == -2);
|
||||
BOOST_TEST(r7.stride() == 1);
|
||||
BOOST_TEST(r7.finish() == 8);
|
||||
}
|
||||
|
||||
// arithmetic operators
|
||||
{
|
||||
range r8 = range(0,5) + 2;
|
||||
BOOST_CHECK(r8.start() == 2);
|
||||
BOOST_CHECK(r8.stride() == 1);
|
||||
BOOST_CHECK(r8.finish() == 7);
|
||||
BOOST_TEST(r8.start() == 2);
|
||||
BOOST_TEST(r8.stride() == 1);
|
||||
BOOST_TEST(r8.finish() == 7);
|
||||
}
|
||||
|
||||
{
|
||||
range r9 = range(0,5) - 2;
|
||||
BOOST_CHECK(r9.start() == -2);
|
||||
BOOST_CHECK(r9.stride() == 1);
|
||||
BOOST_CHECK(r9.finish() == 3);
|
||||
BOOST_TEST(r9.start() == -2);
|
||||
BOOST_TEST(r9.stride() == 1);
|
||||
BOOST_TEST(r9.finish() == 3);
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,15 +14,15 @@
|
||||
// reshape.cpp - testing reshaping functionality
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/type.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
typedef boost::multi_array<int,ndims> array;
|
||||
@ -52,9 +52,9 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 4; ++i)
|
||||
for (array::index j = 0; j != 3; ++j)
|
||||
for (array::index k = 0; k != 2; ++k) {
|
||||
BOOST_CHECK(A[i][j][k] == *ptr);
|
||||
BOOST_CHECK(B[i][j][k] == *ptr);
|
||||
BOOST_CHECK(C[i][j][k] == *ptr++);
|
||||
BOOST_TEST(A[i][j][k] == *ptr);
|
||||
BOOST_TEST(B[i][j][k] == *ptr);
|
||||
BOOST_TEST(C[i][j][k] == *ptr++);
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,13 +80,13 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 4; ++i)
|
||||
for (array::index j = 1; j != 4; ++j)
|
||||
for (array::index k = -1; k != 1; ++k) {
|
||||
BOOST_CHECK(A[i][j][k] == *ptr);
|
||||
BOOST_CHECK(B[i][j][k] == *ptr);
|
||||
BOOST_CHECK(C[i][j][k] == *ptr++);
|
||||
BOOST_TEST(A[i][j][k] == *ptr);
|
||||
BOOST_TEST(B[i][j][k] == *ptr);
|
||||
BOOST_TEST(C[i][j][k] == *ptr++);
|
||||
}
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,13 +14,13 @@
|
||||
// resize.cpp - Test of resizing multi_arrays
|
||||
//
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
|
||||
typedef boost::multi_array<int,3> marray;
|
||||
|
||||
@ -58,7 +58,7 @@ int test_main(int,char*[]) {
|
||||
marray A(boost::extents[2][3][4]);
|
||||
A.assign(A_data,A_data+(2*3*4));
|
||||
A.resize(boost::extents[4][3][2]);
|
||||
BOOST_CHECK(std::equal(A_resize,A_resize+(4*3*2),A.data()));
|
||||
BOOST_TEST(std::equal(A_resize,A_resize+(4*3*2),A.data()));
|
||||
}
|
||||
|
||||
// resize through the Collection
|
||||
@ -67,14 +67,14 @@ int test_main(int,char*[]) {
|
||||
A.assign(A_data,A_data+(2*3*4));
|
||||
boost::array<int,3> new_extents = {{4,3,2}};
|
||||
A.resize(new_extents);
|
||||
BOOST_CHECK(std::equal(A_resize,A_resize+(4*3*2),A.data()));
|
||||
BOOST_TEST(std::equal(A_resize,A_resize+(4*3*2),A.data()));
|
||||
}
|
||||
|
||||
// default construct all the new elements (in this case, all elements)
|
||||
{
|
||||
marray defaultA;
|
||||
defaultA.resize(boost::extents[2][3][4]);
|
||||
BOOST_CHECK(std::accumulate(defaultA.data(),
|
||||
BOOST_TEST(std::accumulate(defaultA.data(),
|
||||
defaultA.data()+(2*3*4),0) == 0);
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ int test_main(int,char*[]) {
|
||||
for (int x = 0; x < 3; x++) {
|
||||
for (int y = 0; y < 4; y++) {
|
||||
for (int z = 0; z < 2; z++) {
|
||||
BOOST_CHECK(*(A.data() + check) == check);
|
||||
BOOST_TEST(*(A.data() + check) == check);
|
||||
++check;
|
||||
}
|
||||
}
|
||||
@ -123,5 +123,5 @@ int test_main(int,char*[]) {
|
||||
}
|
||||
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,12 +14,12 @@
|
||||
// reverse_view.cpp - a small test of creating a view with negative strides
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
|
||||
@ -36,8 +36,8 @@ test_main(int,char*[])
|
||||
array::array_view<1>::type B = A[indices[range(3, -1, -1)]];
|
||||
|
||||
for(multi_array_types::size_type i = 0; i != B.size(); ++i) {
|
||||
BOOST_CHECK(B[i] == rdata[i]);
|
||||
BOOST_TEST(B[i] == rdata[i]);
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,9 +15,9 @@
|
||||
//
|
||||
|
||||
#include "generative_tests.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/mpl/if.hpp"
|
||||
#include "boost/type_traits/is_same.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
template <typename Array>
|
||||
struct view_traits_mutable {
|
||||
@ -71,10 +71,10 @@ void test_views(Array& A, const ViewTraits&) {
|
||||
for (index i = 0; i != 2; ++i)
|
||||
for (index j = 0; j != 2; ++j)
|
||||
for (index k = 0; k != 2; ++k) {
|
||||
BOOST_CHECK(B[i][j][k] == A[idx0+i][idx1+j+1][idx2+k*2]);
|
||||
BOOST_TEST(B[i][j][k] == A[idx0+i][idx1+j+1][idx2+k*2]);
|
||||
boost::array<index,3> elmts;
|
||||
elmts[0]=i; elmts[1]=j; elmts[2]=k;
|
||||
BOOST_CHECK(B(elmts) == A[idx0+i][idx1+j+1][idx2+k*2]);
|
||||
BOOST_TEST(B(elmts) == A[idx0+i][idx1+j+1][idx2+k*2]);
|
||||
}
|
||||
}
|
||||
// Degenerate dimensions
|
||||
@ -84,10 +84,10 @@ void test_views(Array& A, const ViewTraits&) {
|
||||
|
||||
for (index i = 0; i != 2; ++i)
|
||||
for (index j = 0; j != 2; ++j) {
|
||||
BOOST_CHECK(B[i][j] == A[idx0+i][idx1+1][idx2+j*2]);
|
||||
BOOST_TEST(B[i][j] == A[idx0+i][idx1+1][idx2+j*2]);
|
||||
boost::array<index,2> elmts;
|
||||
elmts[0]=i; elmts[1]=j;
|
||||
BOOST_CHECK(B(elmts) == A[idx0+i][idx1+1][idx2+j*2]);
|
||||
BOOST_TEST(B(elmts) == A[idx0+i][idx1+1][idx2+j*2]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,10 +105,10 @@ void test_views(Array& A, const ViewTraits&) {
|
||||
for (index i = 0; i != 2; ++i)
|
||||
for (index j = 0; j != 2; ++j)
|
||||
for (index k = 0; k != 2; ++k) {
|
||||
BOOST_CHECK(B[i][j][k] == A[idx0+i][idx1+j][idx2+2-k]);
|
||||
BOOST_TEST(B[i][j][k] == A[idx0+i][idx1+j][idx2+2-k]);
|
||||
boost::array<index,3> elmts;
|
||||
elmts[0]=i; elmts[1]=j; elmts[2]=k;
|
||||
BOOST_CHECK(B(elmts) == A[idx0+i][idx1+j][idx2+2-k]);
|
||||
BOOST_TEST(B(elmts) == A[idx0+i][idx1+j][idx2+2-k]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,6 +141,6 @@ void access(Array& A, const const_array_tag&) {
|
||||
}
|
||||
|
||||
|
||||
int test_main(int,char*[]) {
|
||||
int main() {
|
||||
return run_generative_tests();
|
||||
}
|
||||
|
@ -14,14 +14,14 @@
|
||||
// stl_interaction.cpp - Make sure multi_arrays work with STL containers.
|
||||
//
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
int
|
||||
test_main(int, char*[])
|
||||
main()
|
||||
{
|
||||
using boost::extents;
|
||||
using boost::indices;
|
||||
@ -51,7 +51,7 @@ test_main(int, char*[])
|
||||
myarray.assign(data,data+data_size);
|
||||
|
||||
array3vec myvec(5,myarray);
|
||||
BOOST_CHECK(myarray == myvec[1]);
|
||||
BOOST_TEST(myarray == myvec[1]);
|
||||
|
||||
array3::array_view<2>::type myview =
|
||||
myarray[indices[1][range(0,2)][range(1,3)]];
|
||||
@ -65,8 +65,8 @@ test_main(int, char*[])
|
||||
|
||||
myvec.push_back(myarray);
|
||||
|
||||
BOOST_CHECK(myarray != myvec[1]);
|
||||
BOOST_CHECK(myarray == myvec[5]);
|
||||
BOOST_TEST(myarray != myvec[1]);
|
||||
BOOST_TEST(myarray == myvec[5]);
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,14 +14,14 @@
|
||||
// storage_order.cpp - testing storage_order-isms.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
const int ndims=3;
|
||||
|
||||
@ -67,7 +67,7 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 2; ++i)
|
||||
for (array::index j = 0; j != 3; ++j)
|
||||
for (array::index k = 0; k != 4; ++k)
|
||||
BOOST_CHECK(A[i][j][k] == *num++);
|
||||
BOOST_TEST(A[i][j][k] == *num++);
|
||||
}
|
||||
|
||||
// Mimic fortran_storage_order using
|
||||
@ -88,7 +88,7 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 2; ++i)
|
||||
for (array::index j = 0; j != 3; ++j)
|
||||
for (array::index k = 0; k != 4; ++k)
|
||||
BOOST_CHECK(A[i][j][k] == *num++);
|
||||
BOOST_TEST(A[i][j][k] == *num++);
|
||||
}
|
||||
|
||||
// general_storage_order with arbitrary storage order
|
||||
@ -119,7 +119,7 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 2; ++i)
|
||||
for (array::index j = 0; j != 3; ++j)
|
||||
for (array::index k = 0; k != 4; ++k)
|
||||
BOOST_CHECK(A[i][j][k] == *num++);
|
||||
BOOST_TEST(A[i][j][k] == *num++);
|
||||
}
|
||||
|
||||
|
||||
@ -152,8 +152,8 @@ test_main(int,char*[])
|
||||
for (array::index i = 0; i != 2; ++i)
|
||||
for (array::index j = 0; j != 3; ++j)
|
||||
for (array::index k = 0; k != 4; ++k)
|
||||
BOOST_CHECK(A[i][j][k] == *num++);
|
||||
BOOST_TEST(A[i][j][k] == *num++);
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,12 +14,12 @@
|
||||
// test out my new storage_order stuff
|
||||
//
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/multi_array/storage_order.hpp"
|
||||
#include <boost/multi_array/storage_order.hpp>
|
||||
|
||||
int
|
||||
test_main(int,char*[]) {
|
||||
main() {
|
||||
|
||||
using namespace boost;
|
||||
|
||||
@ -31,9 +31,9 @@ test_main(int,char*[]) {
|
||||
general_storage_order<5> fortran_storage(fortran_ordering.begin(),
|
||||
ascending.begin());
|
||||
|
||||
BOOST_CHECK(c_storage == (general_storage_order<5>) c_storage_order());
|
||||
BOOST_CHECK(fortran_storage ==
|
||||
BOOST_TEST(c_storage == (general_storage_order<5>) c_storage_order());
|
||||
BOOST_TEST(fortran_storage ==
|
||||
(general_storage_order<5>) fortran_storage_order());
|
||||
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,15 +14,15 @@
|
||||
// index_bases - test of the index_base modifying facilities.
|
||||
//
|
||||
|
||||
#include "boost/multi_array.hpp"
|
||||
#include <boost/multi_array.hpp>
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include "boost/array.hpp"
|
||||
#include <boost/array.hpp>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
int
|
||||
test_main(int,char*[])
|
||||
main()
|
||||
{
|
||||
typedef boost::multi_array<double, 3> array;
|
||||
typedef array::array_view<3>::type array_view;
|
||||
@ -40,5 +40,5 @@ test_main(int,char*[])
|
||||
array_view E = A[indices[irange(1,2)][irange(1,2)][irange(1,2)]];
|
||||
|
||||
}
|
||||
return boost::exit_success;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user