4 #include <UnitTest++.h>
14 template<mem_layout ALLOC,
bool lgBC>
15 struct LongInt2DFixtureGeneric
18 LongInt2DFixtureGeneric()
21 for (
int i=0; i<10; ++i)
22 for (
int j=0; j<9; ++j)
25 ~LongInt2DFixtureGeneric() {}
28 typedef LongInt2DFixtureGeneric<ARPA_TYPE,false> LongInt2DFixture;
29 typedef LongInt2DFixtureGeneric<ARPA_TYPE,true> LongInt2DFixtureBC;
30 typedef LongInt2DFixtureGeneric<C_TYPE,false> LongInt2DFixtureCType;
31 typedef LongInt2DFixtureGeneric<C_TYPE,true> LongInt2DFixtureCTypeBC;
33 template<mem_layout ALLOC,
bool lgBC>
34 struct LongInt3DFixtureGeneric
37 LongInt3DFixtureGeneric()
40 for (
int i=0; i<10; ++i)
41 for (
int j=0; j<9; ++j)
42 for (
int k=0; k<8; ++k)
43 arr[i][j][k] = i*100+j*10+k;
45 ~LongInt3DFixtureGeneric() {}
48 typedef LongInt3DFixtureGeneric<ARPA_TYPE,false> LongInt3DFixture;
49 typedef LongInt3DFixtureGeneric<ARPA_TYPE,true> LongInt3DFixtureBC;
50 typedef LongInt3DFixtureGeneric<C_TYPE,false> LongInt3DFixtureCType;
51 typedef LongInt3DFixtureGeneric<C_TYPE,true> LongInt3DFixtureCTypeBC;
53 struct RealNum3DFixture
60 ~RealNum3DFixture() {}
63 struct Double3DFixture
73 template<mem_layout ALLOC>
74 struct StructWithConstructor3DFixtureGeneric
83 StructWithConstructor3DFixtureGeneric()
87 ~StructWithConstructor3DFixtureGeneric() {}
90 typedef StructWithConstructor3DFixtureGeneric<ARPA_TYPE> StructWithConstructor3DFixture;
91 typedef StructWithConstructor3DFixtureGeneric<C_TYPE> StructWithConstructor3DFixtureCType;
93 template<mem_layout ALLOC,
bool lgBC>
94 struct LongInt4DFixtureGeneric
97 LongInt4DFixtureGeneric()
100 for (
int i=0; i<10; ++i)
101 for (
int j=0; j<9; ++j)
102 for (
int k=0; k<8; ++k)
103 for (
int l=0; l<7; ++l)
104 arr[i][j][k][l] = i*1000+j*100+k*10+l;
106 ~LongInt4DFixtureGeneric() {}
109 typedef LongInt4DFixtureGeneric<ARPA_TYPE,false> LongInt4DFixture;
110 typedef LongInt4DFixtureGeneric<ARPA_TYPE,true> LongInt4DFixtureBC;
111 typedef LongInt4DFixtureGeneric<C_TYPE,false> LongInt4DFixtureCType;
112 typedef LongInt4DFixtureGeneric<C_TYPE,true> LongInt4DFixtureCTypeBC;
114 template<mem_layout ALLOC,
bool lgBC>
115 struct LongInt5DFixtureGeneric
118 LongInt5DFixtureGeneric()
120 arr.
alloc(10,9,8,7,6);
121 for (
int i=0; i<10; ++i)
122 for (
int j=0; j<9; ++j)
123 for (
int k=0; k<8; ++k)
124 for (
int l=0; l<7; ++l)
125 for (
int m=0; m<6; ++m)
126 arr[i][j][k][l][m] = i*10000+j*1000+k*100+l*10+m;
128 ~LongInt5DFixtureGeneric() {}
131 typedef LongInt5DFixtureGeneric<ARPA_TYPE,false> LongInt5DFixture;
132 typedef LongInt5DFixtureGeneric<ARPA_TYPE,true> LongInt5DFixtureBC;
133 typedef LongInt5DFixtureGeneric<C_TYPE,false> LongInt5DFixtureCType;
134 typedef LongInt5DFixtureGeneric<C_TYPE,true> LongInt5DFixtureCTypeBC;
136 template<mem_layout ALLOC,
bool lgBC>
137 struct LongInt6DFixtureGeneric
140 LongInt6DFixtureGeneric()
142 arr.
alloc(10,9,8,7,6,5);
143 for (
int i=0; i<10; ++i)
144 for (
int j=0; j<9; ++j)
145 for (
int k=0; k<8; ++k)
146 for (
int l=0; l<7; ++l)
147 for (
int m=0; m<6; ++m)
148 for (
int n=0; n<5; ++n)
149 arr[i][j][k][l][m][n] =
150 i*100000+j*10000+k*1000+l*100+m*10+n;
152 ~LongInt6DFixtureGeneric() {}
155 typedef LongInt6DFixtureGeneric<ARPA_TYPE,false> LongInt6DFixture;
156 typedef LongInt6DFixtureGeneric<ARPA_TYPE,true> LongInt6DFixtureBC;
157 typedef LongInt6DFixtureGeneric<C_TYPE,false> LongInt6DFixtureCType;
158 typedef LongInt6DFixtureGeneric<C_TYPE,true> LongInt6DFixtureCTypeBC;
160 struct LongInt6DFixtureExplicitReserve
163 LongInt6DFixtureExplicitReserve()
166 for (
int i=0; i<10; ++i)
169 for (
int j=0; j<9; ++j)
172 for (
int k=0; k<8; ++k)
174 arr.reserve(i,j,k,7);
175 for (
int l=0; l<7; ++l)
177 arr.reserve(i,j,k,l,6);
178 for (
int m=0; m<6; ++m)
180 arr.reserve(i,j,k,l,m,5);
188 ~LongInt6DFixtureExplicitReserve() {}
191 struct TestAllocFixture
193 TestAllocFixture() {}
194 ~TestAllocFixture() {}
216 for (
int i=0; i<2; ++i)
217 for (
int j=0; j<3; ++j)
221 for (
int k=0; k<4; ++k)
225 for (
int l=0; l<5; ++l)
227 p4 = a4.ptr(i,j,k,l);
229 for (
int m=0; m<6; ++m)
231 p5 = a5.ptr(i,j,k,l,m);
233 for (
int n=0; n<7; ++n)
235 p6 = a6.ptr(i,j,k,l,m,n);
247 struct LongInt3DCLayoutFixture
250 LongInt3DCLayoutFixture()
253 for (
int i=0; i<10; ++i)
254 for (
int j=0; j<10; ++j)
255 for (
int k=0; k<10; ++k)
256 arr[i][j][k] = 100*i+10*j+k;
258 ~LongInt3DCLayoutFixture() {}
259 long mytest(
const long a[][10][10])
262 for (
int i=0; i<10; ++i)
263 for (
int j=0; j<10; ++j)
264 for (
int k=0; k<10; ++k)
265 res += ( a[i][j][k] != 100*i+10*j+k );
271 template<mem_layout ALLOC>
272 struct LongInt3DCloneFixtureGeneric
275 LongInt3DCloneFixtureGeneric()
278 for (
int i=0; i<10; ++i)
281 for (
int j=0; j<i+1; ++j)
282 arr.reserve(i,j,j+1);
286 ~LongInt3DCloneFixtureGeneric() {}
289 typedef LongInt3DCloneFixtureGeneric<ARPA_TYPE> LongInt3DCloneFixture;
290 typedef LongInt3DCloneFixtureGeneric<C_TYPE> LongInt3DCloneFixtureCType;
292 template<mem_layout ALLOC>
293 struct LongInt2DEmptyDimGeneric
296 LongInt2DEmptyDimGeneric()
299 for (
int i=1; i<2; ++i)
305 ~LongInt2DEmptyDimGeneric() {}
308 typedef LongInt2DEmptyDimGeneric<ARPA_TYPE> LongInt2DEmptyDim;
309 typedef LongInt2DEmptyDimGeneric<C_TYPE> LongInt2DEmptyDimCType;
311 template<mem_layout ALLOC>
312 struct LongInt3DEmptyDimGeneric
315 LongInt3DEmptyDimGeneric()
318 for (
int i=0; i<2; ++i)
321 for (
int j=1; j<2; ++j)
328 ~LongInt3DEmptyDimGeneric() {}
331 typedef LongInt3DEmptyDimGeneric<ARPA_TYPE> LongInt3DEmptyDim;
332 typedef LongInt3DEmptyDimGeneric<C_TYPE> LongInt3DEmptyDimCType;
334 template<mem_layout ALLOC>
335 struct LongInt4DEmptyDimGeneric
338 LongInt4DEmptyDimGeneric()
341 for (
int i=0; i<2; ++i)
344 for (
int j=0; j<2; ++j)
347 for (
int k=1; k<2; ++k)
349 arr.reserve(i,j,k,2);
355 ~LongInt4DEmptyDimGeneric() {}
358 typedef LongInt4DEmptyDimGeneric<ARPA_TYPE> LongInt4DEmptyDim;
359 typedef LongInt4DEmptyDimGeneric<C_TYPE> LongInt4DEmptyDimCType;
361 template<mem_layout ALLOC>
362 struct LongInt5DEmptyDimGeneric
365 LongInt5DEmptyDimGeneric()
368 for (
int i=0; i<2; ++i)
371 for (
int j=0; j<2; ++j)
374 for (
int k=0; k<2; ++k)
376 arr.reserve(i,j,k,2);
377 for (
int l=1; l<2; ++l)
379 arr.reserve(i,j,k,l,2);
386 ~LongInt5DEmptyDimGeneric() {}
389 typedef LongInt5DEmptyDimGeneric<ARPA_TYPE> LongInt5DEmptyDim;
390 typedef LongInt5DEmptyDimGeneric<C_TYPE> LongInt5DEmptyDimCType;
392 template<mem_layout ALLOC>
393 struct LongInt6DEmptyDimGeneric
396 LongInt6DEmptyDimGeneric()
399 for (
int i=0; i<2; ++i)
402 for (
int j=0; j<2; ++j)
405 for (
int k=0; k<2; ++k)
407 arr.reserve(i,j,k,2);
408 for (
int l=0; l<2; ++l)
410 arr.reserve(i,j,k,l,2);
411 for (
int m=1; m<2; ++m)
413 arr.reserve(i,j,k,l,m,2);
421 ~LongInt6DEmptyDimGeneric() {}
424 typedef LongInt6DEmptyDimGeneric<ARPA_TYPE> LongInt6DEmptyDim;
425 typedef LongInt6DEmptyDimGeneric<C_TYPE> LongInt6DEmptyDimCType;
428 TEST_FIXTURE(LongInt2DFixture,TestIteratorPostIncrement)
435 TEST_FIXTURE(LongInt2DFixture,TestIteratorPreIncrement)
442 TEST_FIXTURE(LongInt2DFixture,TestIteratorPostDecrement)
449 TEST_FIXTURE(LongInt2DFixture,TestIteratorPreDecrement)
456 TEST_FIXTURE(LongInt2DFixture,TestIteratorAddition1)
463 TEST_FIXTURE(LongInt2DFixture,TestIteratorSubtraction1)
470 TEST_FIXTURE(LongInt2DFixture,TestIteratorAddition2)
477 TEST_FIXTURE(LongInt2DFixture,TestIteratorSubtraction2)
484 TEST_FIXTURE(LongInt2DFixture,TestIteratorAddition3)
491 TEST_FIXTURE(LongInt2DFixture,TestIteratorSubtraction3)
498 TEST_FIXTURE(LongInt2DFixture,TestIteratorBrackets)
502 CHECK_EQUAL(57,p[1]);
506 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison1)
513 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison2)
520 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison3)
527 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison4)
534 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison5)
541 TEST_FIXTURE(LongInt2DFixture,TestIteratorComparison6)
550 TEST_FIXTURE(LongInt2DFixtureBC,TestIteratorBoundsCheck)
554 CHECK_THROW(
UNUSED long i = *++p,out_of_range);
558 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorPostIncrement)
565 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorPreIncrement)
572 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorPostDecrement)
579 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorPreDecrement)
586 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorAddition1)
593 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorSubtraction1)
600 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorAddition2)
607 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorSubtraction2)
614 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorAddition3)
621 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorSubtraction3)
628 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorBrackets)
632 CHECK_EQUAL(57,p[1]);
635 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison1)
642 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison2)
649 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison3)
656 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison4)
663 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison5)
670 TEST_FIXTURE(LongInt2DFixture,TestConstIteratorComparison6)
678 TEST_FIXTURE(LongInt2DFixtureBC,TestConstIteratorBoundsCheck)
682 CHECK_THROW(
UNUSED long i = *++p,out_of_range);
685 TEST_FIXTURE(LongInt3DFixture,TestDataEmpty)
690 CHECK_EQUAL( 0UL, arr.size() );
691 CHECK( NULL == arr.data() );
695 TEST_FIXTURE(LongInt3DFixture,TestFill)
698 for (
int i=0; i<10; ++i)
699 for (
int j=0; j<9; ++j)
700 for (
int k=0; k<8; ++k)
701 CHECK_EQUAL(0,arr[i][j][k]);
703 for (
int i=0; i<10; ++i)
704 for (
int j=0; j<9; ++j)
705 for (
int k=0; k<8; ++k)
706 CHECK_EQUAL(-1,arr[i][j][k]);
714 TEST_FIXTURE(LongInt3DFixtureCTypeBC,TestFillCType)
717 for (
int i=0; i<10; ++i)
718 for (
int j=0; j<9; ++j)
719 for (
int k=0; k<8; ++k)
720 CHECK_EQUAL(0.,arr[i][j][k]);
722 for (
int i=0; i<10; ++i)
723 for (
int j=0; j<9; ++j)
724 for (
int k=0; k<8; ++k)
725 CHECK_EQUAL(-1,arr[i][j][k]);
728 TEST_FIXTURE(RealNum3DFixture,TestInvalidRealNum)
731 for (
int i=0; i<10; ++i)
732 for (
int j=0; j<9; ++j)
733 for (
int k=0; k<8; ++k)
734 CHECK(
isnan(arr[i][j][k]));
739 TEST_FIXTURE(Double3DFixture,TestInvalidDouble)
742 for (
int i=0; i<10; ++i)
743 for (
int j=0; j<9; ++j)
744 for (
int k=0; k<8; ++k)
745 CHECK(
isnan(arr[i][j][k]));
751 TEST_FIXTURE(LongInt3DFixture,TestStateDo)
753 const char *fnam =
"tma.872GqS";
756 arr.state_do( io,
false );
761 arr.state_do( io,
true );
764 CHECK_EQUAL(304,arr[3][0][4]);
767 TEST_FIXTURE(LongInt3DFixtureCType,TestStateDoCType)
769 const char *fnam =
"tma.872GqS";
772 arr.state_do( io,
false );
777 arr.state_do( io,
true );
780 CHECK_EQUAL(304,arr[3][0][4]);
785 TEST_FIXTURE(LongInt2DFixture,Test2DIndexedValue)
787 CHECK_EQUAL(98,arr[9][8]);
788 CHECK_EQUAL(37,*arr.ptr(3,7));
792 const long& q = (*carr)[7][5];
795 TEST_FIXTURE(LongInt3DFixture,Test3DIndexedValue)
797 CHECK_EQUAL(987,arr[9][8][7]);
798 CHECK_EQUAL(137,*arr.ptr(1,3,7));
802 const long& q = (*carr)[7][5][6];
805 TEST_FIXTURE(LongInt4DFixture,Test4DIndexedValue)
807 CHECK_EQUAL(9876,arr[9][8][7][6]);
808 CHECK_EQUAL(1342,*arr.ptr(1,3,4,2));
811 CHECK_EQUAL(4620,*p);
812 const long& q = (*carr)[7][5][6][3];
815 TEST_FIXTURE(LongInt5DFixture,Test5DIndexedValue)
817 CHECK_EQUAL(98765,arr[9][8][7][6][5]);
818 CHECK_EQUAL(10342,*arr.ptr(1,0,3,4,2));
821 CHECK_EQUAL(46201,*p);
822 const long& q = (*carr)[7][5][6][3][2];
823 CHECK_EQUAL(75632,q);
825 TEST_FIXTURE(LongInt6DFixture,Test6DIndexedValue)
827 CHECK_EQUAL(987654,arr[9][8][7][6][5][4]);
828 CHECK_EQUAL(106423,*arr.ptr(1,0,6,4,2,3));
831 CHECK_EQUAL(462013,*p);
832 const long& q = (*carr)[7][5][6][3][2][1];
833 CHECK_EQUAL(756321,q);
839 TEST_FIXTURE(LongInt2DFixture,Test2DAtOutOfBounds)
841 CHECK_THROW(arr.at(m1,1),out_of_range);
842 CHECK_THROW(arr.at(10,1),out_of_range);
843 CHECK_THROW(arr.at(7,m1),out_of_range);
844 CHECK_THROW(arr.at(7,9),out_of_range);
846 CHECK_THROW(carr->at(m1,1),out_of_range);
847 CHECK_THROW(carr->at(10,1),out_of_range);
848 CHECK_THROW(carr->at(7,m1),out_of_range);
849 CHECK_THROW(carr->at(7,9),out_of_range);
851 TEST_FIXTURE(LongInt3DFixture,Test3DAtOutOfBounds)
853 CHECK_THROW(arr.at(m1,1,2),out_of_range);
854 CHECK_THROW(arr.at(10,1,2),out_of_range);
855 CHECK_THROW(arr.at(7,m1,3),out_of_range);
856 CHECK_THROW(arr.at(7,9,3),out_of_range);
857 CHECK_THROW(arr.at(7,3,m1),out_of_range);
858 CHECK_THROW(arr.at(7,3,8),out_of_range);
860 CHECK_THROW(carr->at(m1,1,2),out_of_range);
861 CHECK_THROW(carr->at(10,1,2),out_of_range);
862 CHECK_THROW(carr->at(7,m1,3),out_of_range);
863 CHECK_THROW(carr->at(7,9,3),out_of_range);
864 CHECK_THROW(carr->at(7,3,m1),out_of_range);
865 CHECK_THROW(carr->at(7,3,8),out_of_range);
867 TEST_FIXTURE(LongInt4DFixture,Test4DAtOutOfBounds)
869 CHECK_THROW(arr.at(m1,1,2,3),out_of_range);
870 CHECK_THROW(arr.at(10,1,2,3),out_of_range);
871 CHECK_THROW(arr.at(7,m1,3,2),out_of_range);
872 CHECK_THROW(arr.at(7,9,3,2),out_of_range);
873 CHECK_THROW(arr.at(7,3,m1,1),out_of_range);
874 CHECK_THROW(arr.at(7,3,8,1),out_of_range);
875 CHECK_THROW(arr.at(7,3,1,m1),out_of_range);
876 CHECK_THROW(arr.at(7,3,1,7),out_of_range);
878 CHECK_THROW(carr->at(m1,1,2,3),out_of_range);
879 CHECK_THROW(carr->at(10,1,2,3),out_of_range);
880 CHECK_THROW(carr->at(7,m1,3,2),out_of_range);
881 CHECK_THROW(carr->at(7,9,3,2),out_of_range);
882 CHECK_THROW(carr->at(7,3,m1,1),out_of_range);
883 CHECK_THROW(carr->at(7,3,8,1),out_of_range);
884 CHECK_THROW(carr->at(7,3,1,m1),out_of_range);
885 CHECK_THROW(carr->at(7,3,1,7),out_of_range);
887 TEST_FIXTURE(LongInt5DFixture,Test5DAtOutOfBounds)
889 CHECK_THROW(arr.at(m1,1,2,3,4),out_of_range);
890 CHECK_THROW(arr.at(10,1,2,3,4),out_of_range);
891 CHECK_THROW(arr.at(7,m1,3,2,4),out_of_range);
892 CHECK_THROW(arr.at(7,9,3,2,4),out_of_range);
893 CHECK_THROW(arr.at(7,3,m1,1,0),out_of_range);
894 CHECK_THROW(arr.at(7,3,8,1,0),out_of_range);
895 CHECK_THROW(arr.at(7,3,1,m1,2),out_of_range);
896 CHECK_THROW(arr.at(7,3,1,7,2),out_of_range);
897 CHECK_THROW(arr.at(7,3,1,2,m1),out_of_range);
898 CHECK_THROW(arr.at(7,3,1,2,6),out_of_range);
900 CHECK_THROW(carr->at(m1,1,2,3,4),out_of_range);
901 CHECK_THROW(carr->at(10,1,2,3,4),out_of_range);
902 CHECK_THROW(carr->at(7,m1,3,2,4),out_of_range);
903 CHECK_THROW(carr->at(7,9,3,2,4),out_of_range);
904 CHECK_THROW(carr->at(7,3,m1,1,0),out_of_range);
905 CHECK_THROW(carr->at(7,3,8,1,0),out_of_range);
906 CHECK_THROW(carr->at(7,3,1,m1,2),out_of_range);
907 CHECK_THROW(carr->at(7,3,1,7,2),out_of_range);
908 CHECK_THROW(carr->at(7,3,1,2,m1),out_of_range);
909 CHECK_THROW(carr->at(7,3,1,2,6),out_of_range);
911 TEST_FIXTURE(LongInt6DFixture,Test6DAtOutOfBounds)
913 CHECK_THROW(arr.at(m1,1,2,3,4,0),out_of_range);
914 CHECK_THROW(arr.at(10,1,2,3,4,0),out_of_range);
915 CHECK_THROW(arr.at(7,m1,3,2,4,1),out_of_range);
916 CHECK_THROW(arr.at(7,9,3,2,4,1),out_of_range);
917 CHECK_THROW(arr.at(7,3,m1,1,0,2),out_of_range);
918 CHECK_THROW(arr.at(7,3,8,1,0,2),out_of_range);
919 CHECK_THROW(arr.at(7,3,1,m1,2,0),out_of_range);
920 CHECK_THROW(arr.at(7,3,1,7,2,0),out_of_range);
921 CHECK_THROW(arr.at(7,4,1,2,m1,3),out_of_range);
922 CHECK_THROW(arr.at(7,4,1,2,6,3),out_of_range);
923 CHECK_THROW(arr.at(7,4,1,2,3,m1),out_of_range);
924 CHECK_THROW(arr.at(7,4,1,2,3,5),out_of_range);
926 CHECK_THROW(carr->at(m1,1,2,3,4,0),out_of_range);
927 CHECK_THROW(carr->at(10,1,2,3,4,0),out_of_range);
928 CHECK_THROW(carr->at(7,m1,3,2,4,1),out_of_range);
929 CHECK_THROW(carr->at(7,9,3,2,4,1),out_of_range);
930 CHECK_THROW(carr->at(7,3,m1,1,0,2),out_of_range);
931 CHECK_THROW(carr->at(7,3,8,1,0,2),out_of_range);
932 CHECK_THROW(carr->at(7,3,1,m1,2,0),out_of_range);
933 CHECK_THROW(carr->at(7,3,1,7,2,0),out_of_range);
934 CHECK_THROW(carr->at(7,4,1,2,m1,3),out_of_range);
935 CHECK_THROW(carr->at(7,4,1,2,6,3),out_of_range);
936 CHECK_THROW(carr->at(7,4,1,2,3,m1),out_of_range);
937 CHECK_THROW(carr->at(7,4,1,2,3,5),out_of_range);
940 TEST_FIXTURE(LongInt2DFixtureBC,Test2DOutOfBounds)
942 CHECK_THROW(arr[m1][1],out_of_range);
943 CHECK_THROW(arr[10][1],out_of_range);
944 CHECK_THROW(arr[7][m1],out_of_range);
945 CHECK_THROW(arr[7][9],out_of_range);
946 CHECK_THROW(arr.ptr(m1,1),out_of_range);
947 CHECK_THROW(arr.ptr(10,1),out_of_range);
949 CHECK_THROW((*carr)[m1][1],out_of_range);
950 CHECK_THROW((*carr)[10][1],out_of_range);
951 CHECK_THROW((*carr)[7][m1],out_of_range);
952 CHECK_THROW((*carr)[7][9],out_of_range);
954 TEST_FIXTURE(LongInt3DFixtureBC,Test3DOutOfBounds)
956 CHECK_THROW(arr[m1][1][2],out_of_range);
957 CHECK_THROW(arr[10][1][2],out_of_range);
958 CHECK_THROW(arr[7][m1][3],out_of_range);
959 CHECK_THROW(arr[7][9][3],out_of_range);
960 CHECK_THROW(arr[7][3][m1],out_of_range);
961 CHECK_THROW(arr[7][3][8],out_of_range);
962 CHECK_THROW(arr.ptr(m1,1,2),out_of_range);
963 CHECK_THROW(arr.ptr(10,1,2),out_of_range);
964 CHECK_THROW(arr.ptr(7,m1,3),out_of_range);
965 CHECK_THROW(arr.ptr(7,9,3),out_of_range);
967 CHECK_THROW((*carr)[m1][1][2],out_of_range);
968 CHECK_THROW((*carr)[10][1][2],out_of_range);
969 CHECK_THROW((*carr)[7][m1][3],out_of_range);
970 CHECK_THROW((*carr)[7][9][3],out_of_range);
971 CHECK_THROW((*carr)[7][3][m1],out_of_range);
972 CHECK_THROW((*carr)[7][3][8],out_of_range);
974 TEST_FIXTURE(LongInt4DFixtureBC,Test4DOutOfBounds)
976 CHECK_THROW(arr[m1][1][2][3],out_of_range);
977 CHECK_THROW(arr[10][1][2][3],out_of_range);
978 CHECK_THROW(arr[7][m1][3][2],out_of_range);
979 CHECK_THROW(arr[7][9][3][2],out_of_range);
980 CHECK_THROW(arr[7][3][m1][1],out_of_range);
981 CHECK_THROW(arr[7][3][8][1],out_of_range);
982 CHECK_THROW(arr[7][3][1][m1],out_of_range);
983 CHECK_THROW(arr[7][3][1][7],out_of_range);
984 CHECK_THROW(arr.ptr(m1,1,2,3),out_of_range);
985 CHECK_THROW(arr.ptr(10,1,2,3),out_of_range);
986 CHECK_THROW(arr.ptr(7,m1,3,2),out_of_range);
987 CHECK_THROW(arr.ptr(7,9,3,2),out_of_range);
988 CHECK_THROW(arr.ptr(7,3,m1,1),out_of_range);
989 CHECK_THROW(arr.ptr(7,3,8,1),out_of_range);
991 CHECK_THROW((*carr)[m1][1][2][3],out_of_range);
992 CHECK_THROW((*carr)[10][1][2][3],out_of_range);
993 CHECK_THROW((*carr)[7][m1][3][2],out_of_range);
994 CHECK_THROW((*carr)[7][9][3][2],out_of_range);
995 CHECK_THROW((*carr)[7][3][m1][1],out_of_range);
996 CHECK_THROW((*carr)[7][3][8][1],out_of_range);
997 CHECK_THROW((*carr)[7][3][1][m1],out_of_range);
998 CHECK_THROW((*carr)[7][3][1][7],out_of_range);
1000 TEST_FIXTURE(LongInt5DFixtureBC,Test5DOutOfBounds)
1002 CHECK_THROW(arr[m1][1][2][3][4],out_of_range);
1003 CHECK_THROW(arr[10][1][2][3][4],out_of_range);
1004 CHECK_THROW(arr[7][m1][3][2][4],out_of_range);
1005 CHECK_THROW(arr[7][9][3][2][4],out_of_range);
1006 CHECK_THROW(arr[7][3][m1][1][0],out_of_range);
1007 CHECK_THROW(arr[7][3][8][1][0],out_of_range);
1008 CHECK_THROW(arr[7][3][1][m1][2],out_of_range);
1009 CHECK_THROW(arr[7][3][1][7][2],out_of_range);
1010 CHECK_THROW(arr[7][3][1][2][m1],out_of_range);
1011 CHECK_THROW(arr[7][3][1][2][6],out_of_range);
1012 CHECK_THROW(arr.ptr(m1,1,2,3,4),out_of_range);
1013 CHECK_THROW(arr.ptr(10,1,2,3,4),out_of_range);
1014 CHECK_THROW(arr.ptr(7,m1,3,2,4),out_of_range);
1015 CHECK_THROW(arr.ptr(7,9,3,2,4),out_of_range);
1016 CHECK_THROW(arr.ptr(7,3,m1,1,0),out_of_range);
1017 CHECK_THROW(arr.ptr(7,3,8,1,0),out_of_range);
1018 CHECK_THROW(arr.ptr(7,3,1,m1,2),out_of_range);
1019 CHECK_THROW(arr.ptr(7,3,1,7,2),out_of_range);
1021 CHECK_THROW((*carr)[m1][1][2][3][4],out_of_range);
1022 CHECK_THROW((*carr)[10][1][2][3][4],out_of_range);
1023 CHECK_THROW((*carr)[7][m1][3][2][4],out_of_range);
1024 CHECK_THROW((*carr)[7][9][3][2][4],out_of_range);
1025 CHECK_THROW((*carr)[7][3][m1][1][0],out_of_range);
1026 CHECK_THROW((*carr)[7][3][8][1][0],out_of_range);
1027 CHECK_THROW((*carr)[7][3][1][m1][2],out_of_range);
1028 CHECK_THROW((*carr)[7][3][1][7][2],out_of_range);
1029 CHECK_THROW((*carr)[7][3][1][2][m1],out_of_range);
1030 CHECK_THROW((*carr)[7][3][1][2][6],out_of_range);
1032 TEST_FIXTURE(LongInt6DFixtureBC,Test6DOutOfBounds)
1034 CHECK_THROW(arr[m1][1][2][3][4][0],out_of_range);
1035 CHECK_THROW(arr[10][1][2][3][4][0],out_of_range);
1036 CHECK_THROW(arr[7][m1][3][2][4][1],out_of_range);
1037 CHECK_THROW(arr[7][9][3][2][4][1],out_of_range);
1038 CHECK_THROW(arr[7][3][m1][1][0][2],out_of_range);
1039 CHECK_THROW(arr[7][3][8][1][0][2],out_of_range);
1040 CHECK_THROW(arr[7][3][1][m1][2][0],out_of_range);
1041 CHECK_THROW(arr[7][3][1][7][2][0],out_of_range);
1042 CHECK_THROW(arr[7][4][1][2][m1][3],out_of_range);
1043 CHECK_THROW(arr[7][4][1][2][6][3],out_of_range);
1044 CHECK_THROW(arr[7][4][1][2][3][m1],out_of_range);
1045 CHECK_THROW(arr[7][4][1][2][3][5],out_of_range);
1046 CHECK_THROW(arr.ptr(m1,1,2,3,4,0),out_of_range);
1047 CHECK_THROW(arr.ptr(10,1,2,3,4,0),out_of_range);
1048 CHECK_THROW(arr.ptr(7,m1,3,2,4,1),out_of_range);
1049 CHECK_THROW(arr.ptr(7,9,3,2,4,1),out_of_range);
1050 CHECK_THROW(arr.ptr(7,3,m1,1,0,2),out_of_range);
1051 CHECK_THROW(arr.ptr(7,3,8,1,0,2),out_of_range);
1052 CHECK_THROW(arr.ptr(7,3,1,m1,2,0),out_of_range);
1053 CHECK_THROW(arr.ptr(7,3,1,7,2,0),out_of_range);
1054 CHECK_THROW(arr.ptr(7,4,1,2,m1,3),out_of_range);
1055 CHECK_THROW(arr.ptr(7,4,1,2,6,3),out_of_range);
1057 CHECK_THROW((*carr)[m1][1][2][3][4][0],out_of_range);
1058 CHECK_THROW((*carr)[10][1][2][3][4][0],out_of_range);
1059 CHECK_THROW((*carr)[7][m1][3][2][4][1],out_of_range);
1060 CHECK_THROW((*carr)[7][9][3][2][4][1],out_of_range);
1061 CHECK_THROW((*carr)[7][3][m1][1][0][2],out_of_range);
1062 CHECK_THROW((*carr)[7][3][8][1][0][2],out_of_range);
1063 CHECK_THROW((*carr)[7][3][1][m1][2][0],out_of_range);
1064 CHECK_THROW((*carr)[7][3][1][7][2][0],out_of_range);
1065 CHECK_THROW((*carr)[7][4][1][2][m1][3],out_of_range);
1066 CHECK_THROW((*carr)[7][4][1][2][6][3],out_of_range);
1067 CHECK_THROW((*carr)[7][4][1][2][3][m1],out_of_range);
1068 CHECK_THROW((*carr)[7][4][1][2][3][5],out_of_range);
1072 TEST_FIXTURE(LongInt2DFixtureCType,Test2DIndexedValueCType)
1074 CHECK_EQUAL(98,arr[9][8]);
1075 CHECK_EQUAL(37,*arr.ptr(3,7));
1079 const long& q = (*carr)[7][5];
1082 TEST_FIXTURE(LongInt3DFixtureCType,Test3DIndexedValueCType)
1084 CHECK_EQUAL(987,arr[9][8][7]);
1085 CHECK_EQUAL(137,*arr.ptr(1,3,7));
1088 CHECK_EQUAL(462,*p);
1089 const long& q = (*carr)[7][5][6];
1092 TEST_FIXTURE(LongInt4DFixtureCType,Test4DIndexedValueCType)
1094 CHECK_EQUAL(9876,arr[9][8][7][6]);
1095 CHECK_EQUAL(1342,*arr.ptr(1,3,4,2));
1098 CHECK_EQUAL(4620,*p);
1099 const long& q = (*carr)[7][5][6][3];
1100 CHECK_EQUAL(7563,q);
1102 TEST_FIXTURE(LongInt5DFixtureCType,Test5DIndexedValueCType)
1104 CHECK_EQUAL(98765,arr[9][8][7][6][5]);
1105 CHECK_EQUAL(10342,*arr.ptr(1,0,3,4,2));
1108 CHECK_EQUAL(46201,*p);
1109 const long& q = (*carr)[7][5][6][3][2];
1110 CHECK_EQUAL(75632,q);
1112 TEST_FIXTURE(LongInt6DFixtureCType,Test6DIndexedValueCType)
1114 CHECK_EQUAL(987654,arr[9][8][7][6][5][4]);
1115 CHECK_EQUAL(106423,*arr.ptr(1,0,6,4,2,3));
1118 CHECK_EQUAL(462013,*p);
1119 const long& q = (*carr)[7][5][6][3][2][1];
1120 CHECK_EQUAL(756321,q);
1123 TEST_FIXTURE(LongInt2DFixtureCType,Test2DAtOutOfBoundsCType)
1125 CHECK_THROW(arr.at(m1,1),out_of_range);
1126 CHECK_THROW(arr.at(10,1),out_of_range);
1127 CHECK_THROW(arr.at(7,m1),out_of_range);
1128 CHECK_THROW(arr.at(7,9),out_of_range);
1130 CHECK_THROW(carr->at(m1,1),out_of_range);
1131 CHECK_THROW(carr->at(10,1),out_of_range);
1132 CHECK_THROW(carr->at(7,m1),out_of_range);
1133 CHECK_THROW(carr->at(7,9),out_of_range);
1135 TEST_FIXTURE(LongInt3DFixtureCType,Test3DAtOutOfBoundsCType)
1137 CHECK_THROW(arr.at(m1,1,2),out_of_range);
1138 CHECK_THROW(arr.at(10,1,2),out_of_range);
1139 CHECK_THROW(arr.at(7,m1,3),out_of_range);
1140 CHECK_THROW(arr.at(7,9,3),out_of_range);
1141 CHECK_THROW(arr.at(7,3,m1),out_of_range);
1142 CHECK_THROW(arr.at(7,3,8),out_of_range);
1144 CHECK_THROW(carr->at(m1,1,2),out_of_range);
1145 CHECK_THROW(carr->at(10,1,2),out_of_range);
1146 CHECK_THROW(carr->at(7,m1,3),out_of_range);
1147 CHECK_THROW(carr->at(7,9,3),out_of_range);
1148 CHECK_THROW(carr->at(7,3,m1),out_of_range);
1149 CHECK_THROW(carr->at(7,3,8),out_of_range);
1151 TEST_FIXTURE(LongInt4DFixtureCType,Test4DAtOutOfBoundsCType)
1153 CHECK_THROW(arr.at(m1,1,2,3),out_of_range);
1154 CHECK_THROW(arr.at(10,1,2,3),out_of_range);
1155 CHECK_THROW(arr.at(7,m1,3,2),out_of_range);
1156 CHECK_THROW(arr.at(7,9,3,2),out_of_range);
1157 CHECK_THROW(arr.at(7,3,m1,1),out_of_range);
1158 CHECK_THROW(arr.at(7,3,8,1),out_of_range);
1159 CHECK_THROW(arr.at(7,3,1,m1),out_of_range);
1160 CHECK_THROW(arr.at(7,3,1,7),out_of_range);
1162 CHECK_THROW(carr->at(m1,1,2,3),out_of_range);
1163 CHECK_THROW(carr->at(10,1,2,3),out_of_range);
1164 CHECK_THROW(carr->at(7,m1,3,2),out_of_range);
1165 CHECK_THROW(carr->at(7,9,3,2),out_of_range);
1166 CHECK_THROW(carr->at(7,3,m1,1),out_of_range);
1167 CHECK_THROW(carr->at(7,3,8,1),out_of_range);
1168 CHECK_THROW(carr->at(7,3,1,m1),out_of_range);
1169 CHECK_THROW(carr->at(7,3,1,7),out_of_range);
1171 TEST_FIXTURE(LongInt5DFixtureCType,Test5DAtOutOfBoundsCType)
1173 CHECK_THROW(arr.at(m1,1,2,3,4),out_of_range);
1174 CHECK_THROW(arr.at(10,1,2,3,4),out_of_range);
1175 CHECK_THROW(arr.at(7,m1,3,2,4),out_of_range);
1176 CHECK_THROW(arr.at(7,9,3,2,4),out_of_range);
1177 CHECK_THROW(arr.at(7,3,m1,1,0),out_of_range);
1178 CHECK_THROW(arr.at(7,3,8,1,0),out_of_range);
1179 CHECK_THROW(arr.at(7,3,1,m1,2),out_of_range);
1180 CHECK_THROW(arr.at(7,3,1,7,2),out_of_range);
1181 CHECK_THROW(arr.at(7,3,1,2,m1),out_of_range);
1182 CHECK_THROW(arr.at(7,3,1,2,6),out_of_range);
1184 CHECK_THROW(carr->at(m1,1,2,3,4),out_of_range);
1185 CHECK_THROW(carr->at(10,1,2,3,4),out_of_range);
1186 CHECK_THROW(carr->at(7,m1,3,2,4),out_of_range);
1187 CHECK_THROW(carr->at(7,9,3,2,4),out_of_range);
1188 CHECK_THROW(carr->at(7,3,m1,1,0),out_of_range);
1189 CHECK_THROW(carr->at(7,3,8,1,0),out_of_range);
1190 CHECK_THROW(carr->at(7,3,1,m1,2),out_of_range);
1191 CHECK_THROW(carr->at(7,3,1,7,2),out_of_range);
1192 CHECK_THROW(carr->at(7,3,1,2,m1),out_of_range);
1193 CHECK_THROW(carr->at(7,3,1,2,6),out_of_range);
1195 TEST_FIXTURE(LongInt6DFixtureCType,Test6DAtOutOfBoundsCType)
1197 CHECK_THROW(arr.at(m1,1,2,3,4,0),out_of_range);
1198 CHECK_THROW(arr.at(10,1,2,3,4,0),out_of_range);
1199 CHECK_THROW(arr.at(7,m1,3,2,4,1),out_of_range);
1200 CHECK_THROW(arr.at(7,9,3,2,4,1),out_of_range);
1201 CHECK_THROW(arr.at(7,3,m1,1,0,2),out_of_range);
1202 CHECK_THROW(arr.at(7,3,8,1,0,2),out_of_range);
1203 CHECK_THROW(arr.at(7,3,1,m1,2,0),out_of_range);
1204 CHECK_THROW(arr.at(7,3,1,7,2,0),out_of_range);
1205 CHECK_THROW(arr.at(7,4,1,2,m1,3),out_of_range);
1206 CHECK_THROW(arr.at(7,4,1,2,6,3),out_of_range);
1207 CHECK_THROW(arr.at(7,4,1,2,3,m1),out_of_range);
1208 CHECK_THROW(arr.at(7,4,1,2,3,5),out_of_range);
1210 CHECK_THROW(carr->at(m1,1,2,3,4,0),out_of_range);
1211 CHECK_THROW(carr->at(10,1,2,3,4,0),out_of_range);
1212 CHECK_THROW(carr->at(7,m1,3,2,4,1),out_of_range);
1213 CHECK_THROW(carr->at(7,9,3,2,4,1),out_of_range);
1214 CHECK_THROW(carr->at(7,3,m1,1,0,2),out_of_range);
1215 CHECK_THROW(carr->at(7,3,8,1,0,2),out_of_range);
1216 CHECK_THROW(carr->at(7,3,1,m1,2,0),out_of_range);
1217 CHECK_THROW(carr->at(7,3,1,7,2,0),out_of_range);
1218 CHECK_THROW(carr->at(7,4,1,2,m1,3),out_of_range);
1219 CHECK_THROW(carr->at(7,4,1,2,6,3),out_of_range);
1220 CHECK_THROW(carr->at(7,4,1,2,3,m1),out_of_range);
1221 CHECK_THROW(carr->at(7,4,1,2,3,5),out_of_range);
1224 TEST_FIXTURE(LongInt2DFixtureCTypeBC,Test2DOutOfBoundsCType)
1226 CHECK_THROW(arr[m1][1],out_of_range);
1227 CHECK_THROW(arr[10][1],out_of_range);
1228 CHECK_THROW(arr[7][m1],out_of_range);
1229 CHECK_THROW(arr[7][9],out_of_range);
1230 CHECK_THROW(arr.ptr(m1,1),out_of_range);
1231 CHECK_THROW(arr.ptr(10,1),out_of_range);
1233 CHECK_THROW((*carr)[m1][1],out_of_range);
1234 CHECK_THROW((*carr)[10][1],out_of_range);
1235 CHECK_THROW((*carr)[7][m1],out_of_range);
1236 CHECK_THROW((*carr)[7][9],out_of_range);
1238 TEST_FIXTURE(LongInt3DFixtureCTypeBC,Test3DOutOfBoundsCType)
1240 CHECK_THROW(arr[m1][1][2],out_of_range);
1241 CHECK_THROW(arr[10][1][2],out_of_range);
1242 CHECK_THROW(arr[7][m1][3],out_of_range);
1243 CHECK_THROW(arr[7][9][3],out_of_range);
1244 CHECK_THROW(arr[7][3][m1],out_of_range);
1245 CHECK_THROW(arr[7][3][8],out_of_range);
1246 CHECK_THROW(arr.ptr(m1,1,2),out_of_range);
1247 CHECK_THROW(arr.ptr(10,1,2),out_of_range);
1248 CHECK_THROW(arr.ptr(7,m1,3),out_of_range);
1249 CHECK_THROW(arr.ptr(7,9,3),out_of_range);
1251 CHECK_THROW((*carr)[m1][1][2],out_of_range);
1252 CHECK_THROW((*carr)[10][1][2],out_of_range);
1253 CHECK_THROW((*carr)[7][m1][3],out_of_range);
1254 CHECK_THROW((*carr)[7][9][3],out_of_range);
1255 CHECK_THROW((*carr)[7][3][m1],out_of_range);
1256 CHECK_THROW((*carr)[7][3][8],out_of_range);
1258 TEST_FIXTURE(LongInt4DFixtureCTypeBC,Test4DOutOfBoundsCType)
1260 CHECK_THROW(arr[m1][1][2][3],out_of_range);
1261 CHECK_THROW(arr[10][1][2][3],out_of_range);
1262 CHECK_THROW(arr[7][m1][3][2],out_of_range);
1263 CHECK_THROW(arr[7][9][3][2],out_of_range);
1264 CHECK_THROW(arr[7][3][m1][1],out_of_range);
1265 CHECK_THROW(arr[7][3][8][1],out_of_range);
1266 CHECK_THROW(arr[7][3][1][m1],out_of_range);
1267 CHECK_THROW(arr[7][3][1][7],out_of_range);
1268 CHECK_THROW(arr.ptr(m1,1,2,3),out_of_range);
1269 CHECK_THROW(arr.ptr(10,1,2,3),out_of_range);
1270 CHECK_THROW(arr.ptr(7,m1,3,2),out_of_range);
1271 CHECK_THROW(arr.ptr(7,9,3,2),out_of_range);
1272 CHECK_THROW(arr.ptr(7,3,m1,1),out_of_range);
1273 CHECK_THROW(arr.ptr(7,3,8,1),out_of_range);
1275 CHECK_THROW((*carr)[m1][1][2][3],out_of_range);
1276 CHECK_THROW((*carr)[10][1][2][3],out_of_range);
1277 CHECK_THROW((*carr)[7][m1][3][2],out_of_range);
1278 CHECK_THROW((*carr)[7][9][3][2],out_of_range);
1279 CHECK_THROW((*carr)[7][3][m1][1],out_of_range);
1280 CHECK_THROW((*carr)[7][3][8][1],out_of_range);
1281 CHECK_THROW((*carr)[7][3][1][m1],out_of_range);
1282 CHECK_THROW((*carr)[7][3][1][7],out_of_range);
1284 TEST_FIXTURE(LongInt5DFixtureCTypeBC,Test5DOutOfBoundsCType)
1286 CHECK_THROW(arr[m1][1][2][3][4],out_of_range);
1287 CHECK_THROW(arr[10][1][2][3][4],out_of_range);
1288 CHECK_THROW(arr[7][m1][3][2][4],out_of_range);
1289 CHECK_THROW(arr[7][9][3][2][4],out_of_range);
1290 CHECK_THROW(arr[7][3][m1][1][0],out_of_range);
1291 CHECK_THROW(arr[7][3][8][1][0],out_of_range);
1292 CHECK_THROW(arr[7][3][1][m1][2],out_of_range);
1293 CHECK_THROW(arr[7][3][1][7][2],out_of_range);
1294 CHECK_THROW(arr[7][3][1][2][m1],out_of_range);
1295 CHECK_THROW(arr[7][3][1][2][6],out_of_range);
1296 CHECK_THROW(arr.ptr(m1,1,2,3,4),out_of_range);
1297 CHECK_THROW(arr.ptr(10,1,2,3,4),out_of_range);
1298 CHECK_THROW(arr.ptr(7,m1,3,2,4),out_of_range);
1299 CHECK_THROW(arr.ptr(7,9,3,2,4),out_of_range);
1300 CHECK_THROW(arr.ptr(7,3,m1,1,0),out_of_range);
1301 CHECK_THROW(arr.ptr(7,3,8,1,0),out_of_range);
1302 CHECK_THROW(arr.ptr(7,3,1,m1,2),out_of_range);
1303 CHECK_THROW(arr.ptr(7,3,1,7,2),out_of_range);
1305 CHECK_THROW((*carr)[m1][1][2][3][4],out_of_range);
1306 CHECK_THROW((*carr)[10][1][2][3][4],out_of_range);
1307 CHECK_THROW((*carr)[7][m1][3][2][4],out_of_range);
1308 CHECK_THROW((*carr)[7][9][3][2][4],out_of_range);
1309 CHECK_THROW((*carr)[7][3][m1][1][0],out_of_range);
1310 CHECK_THROW((*carr)[7][3][8][1][0],out_of_range);
1311 CHECK_THROW((*carr)[7][3][1][m1][2],out_of_range);
1312 CHECK_THROW((*carr)[7][3][1][7][2],out_of_range);
1313 CHECK_THROW((*carr)[7][3][1][2][m1],out_of_range);
1314 CHECK_THROW((*carr)[7][3][1][2][6],out_of_range);
1316 TEST_FIXTURE(LongInt6DFixtureCTypeBC,Test6DOutOfBoundsCType)
1318 CHECK_THROW(arr[m1][1][2][3][4][0],out_of_range);
1319 CHECK_THROW(arr[10][1][2][3][4][0],out_of_range);
1320 CHECK_THROW(arr[7][m1][3][2][4][1],out_of_range);
1321 CHECK_THROW(arr[7][9][3][2][4][1],out_of_range);
1322 CHECK_THROW(arr[7][3][m1][1][0][2],out_of_range);
1323 CHECK_THROW(arr[7][3][8][1][0][2],out_of_range);
1324 CHECK_THROW(arr[7][3][1][m1][2][0],out_of_range);
1325 CHECK_THROW(arr[7][3][1][7][2][0],out_of_range);
1326 CHECK_THROW(arr[7][4][1][2][m1][3],out_of_range);
1327 CHECK_THROW(arr[7][4][1][2][6][3],out_of_range);
1328 CHECK_THROW(arr[7][4][1][2][3][m1],out_of_range);
1329 CHECK_THROW(arr[7][4][1][2][3][5],out_of_range);
1330 CHECK_THROW(arr.ptr(m1,1,2,3,4,0),out_of_range);
1331 CHECK_THROW(arr.ptr(10,1,2,3,4,0),out_of_range);
1332 CHECK_THROW(arr.ptr(7,m1,3,2,4,1),out_of_range);
1333 CHECK_THROW(arr.ptr(7,9,3,2,4,1),out_of_range);
1334 CHECK_THROW(arr.ptr(7,3,m1,1,0,2),out_of_range);
1335 CHECK_THROW(arr.ptr(7,3,8,1,0,2),out_of_range);
1336 CHECK_THROW(arr.ptr(7,3,1,m1,2,0),out_of_range);
1337 CHECK_THROW(arr.ptr(7,3,1,7,2,0),out_of_range);
1338 CHECK_THROW(arr.ptr(7,4,1,2,m1,3),out_of_range);
1339 CHECK_THROW(arr.ptr(7,4,1,2,6,3),out_of_range);
1341 CHECK_THROW((*carr)[m1][1][2][3][4][0],out_of_range);
1342 CHECK_THROW((*carr)[10][1][2][3][4][0],out_of_range);
1343 CHECK_THROW((*carr)[7][m1][3][2][4][1],out_of_range);
1344 CHECK_THROW((*carr)[7][9][3][2][4][1],out_of_range);
1345 CHECK_THROW((*carr)[7][3][m1][1][0][2],out_of_range);
1346 CHECK_THROW((*carr)[7][3][8][1][0][2],out_of_range);
1347 CHECK_THROW((*carr)[7][3][1][m1][2][0],out_of_range);
1348 CHECK_THROW((*carr)[7][3][1][7][2][0],out_of_range);
1349 CHECK_THROW((*carr)[7][4][1][2][m1][3],out_of_range);
1350 CHECK_THROW((*carr)[7][4][1][2][6][3],out_of_range);
1351 CHECK_THROW((*carr)[7][4][1][2][3][m1],out_of_range);
1352 CHECK_THROW((*carr)[7][4][1][2][3][5],out_of_range);
1357 TEST_FIXTURE(StructWithConstructor3DFixture,TestConstructorExecuted)
1360 CHECK_EQUAL(23,p1->n);
1362 CHECK_EQUAL(23,p2->n);
1364 TEST_FIXTURE(StructWithConstructor3DFixtureCType,TestConstructorExecutedCType)
1367 CHECK_EQUAL(23,p1->n);
1369 CHECK_EQUAL(23,p2->n);
1373 TEST_FIXTURE(LongInt3DFixtureBC,TestSize)
1375 CHECK_EQUAL((
size_t)(10*9*8),arr.size());
1379 arr.alloc(10,11,12);
1380 CHECK_EQUAL((
size_t)(10*11*12),arr.capacity());
1385 for (
int i=0; i<10; ++i)
1386 for (
int j=0; j<11; ++j)
1389 for (
int k=0; k<12; ++k)
1390 CHECK_EQUAL(0,p[k]);
1396 TEST_FIXTURE(LongInt3DFixtureBC,TestSizeAlgorithm)
1399 arr.alloc(10,11,12);
1402 for (
int i=0; i<10; ++i)
1403 for (
int j=0; j<11; ++j)
1405 CHECK_EQUAL(0,count_if(arr.begin(i,j),arr.end(i,j),
1406 bind1st(not_equal_to<long>(),0)));
1410 TEST_FIXTURE(LongInt3DFixtureCTypeBC,TestSizeCType)
1412 CHECK_EQUAL((
size_t)(10*9*8),arr.size());
1416 arr.alloc(10,11,12);
1417 CHECK_EQUAL((
size_t)(10*11*12),arr.capacity());
1422 for (
int i=0; i<10; ++i)
1423 for (
int j=0; j<11; ++j)
1426 for (
int k=0; k<12; ++k)
1427 CHECK_EQUAL(0,p[k]);
1432 TEST_FIXTURE(LongInt6DFixtureExplicitReserve,TestExplicitReserve)
1435 for (
int i=0; i<10; ++i)
1436 for (
int j=0; j<9; ++j)
1437 for (
int k=0; k<8; ++k)
1438 for (
int l=0; l<7; ++l)
1439 for (
int m=0; m<6; ++m)
1440 for (
int n=0; n<5; ++n)
1441 CHECK_EQUAL(0,arr[i][j][k][l][m][n]);
1448 TEST_FIXTURE(TestAllocFixture,TestVariantAlloc)
1450 CHECK_EQUAL(0,mytest());
1455 TEST_FIXTURE(LongInt3DFixture,TestData)
1457 CHECK_EQUAL(&arr[0][0][0],arr.data());
1458 arr[0][0][0] = 1234;
1459 CHECK_EQUAL(1234,*arr.data());
1461 CHECK_EQUAL(&arr[0][0][0],carr->data());
1463 TEST_FIXTURE(LongInt3DFixtureCType,TestDataCType)
1465 CHECK_EQUAL(&arr[0][0][0],arr.data());
1466 arr[0][0][0] = 1234;
1467 CHECK_EQUAL(1234,*arr.data());
1469 CHECK_EQUAL(&arr[0][0][0],carr->data());
1472 TEST_FIXTURE(LongInt6DFixture,TestCopyOperator)
1475 CHECK( arr.size() != arr2.size() );
1477 CHECK_EQUAL(0,arr2[0][1][2][3][4][5]);
1479 CHECK( arr.size() == arr2.size() );
1481 CHECK( &arr[0][1][2][3][4][5] != &arr2[0][1][2][3][4][5] );
1482 for (
int i=0; i<10; ++i)
1483 for (
int j=0; j<9; ++j)
1484 for (
int k=0; k<8; ++k)
1485 for (
int l=0; l<7; ++l)
1486 for (
int m=0; m<6; ++m)
1487 for (
int n=0; n<5; ++n)
1489 long z = i*100000+j*10000+k*1000+l*100+m*10+n;
1490 CHECK_EQUAL(z,arr2[i][j][k][l][m][n]);
1497 CHECK_EQUAL(712344,arr2[7][1][2][3][4][4]);
1501 CHECK( arr.size() == arr3.
size() );
1503 CHECK( &arr[7][1][2][3][4][4] != &arr3[7][1][2][3][4][4] );
1504 CHECK_EQUAL(arr[7][1][2][3][4][4],arr3[7][1][2][3][4][4]);
1509 CHECK(arr2.empty());
1512 CHECK(arr4.empty());
1515 TEST_FIXTURE(LongInt6DFixtureBC,TestCopyOperatorBC)
1518 CHECK( arr.size() != arr2.size() );
1520 CHECK_EQUAL(0,arr2[0][1][2][3][4][5]);
1522 CHECK( arr.size() == arr2.size() );
1523 for (
int i=0; i<10; ++i)
1524 for (
int j=0; j<9; ++j)
1525 for (
int k=0; k<8; ++k)
1526 for (
int l=0; l<7; ++l)
1527 for (
int m=0; m<6; ++m)
1528 for (
int n=0; n<5; ++n)
1530 long z = i*100000+j*10000+k*1000+l*100+m*10+n;
1531 CHECK_EQUAL(z,arr2[i][j][k][l][m][n]);
1534 CHECK_THROW(arr2[m1][1][2][3][4][0],out_of_range);
1535 CHECK_THROW(arr2[10][1][2][3][4][0],out_of_range);
1536 CHECK_THROW(arr2[7][m1][3][2][4][1],out_of_range);
1537 CHECK_THROW(arr2[7][9][3][2][4][1],out_of_range);
1538 CHECK_THROW(arr2[7][3][m1][1][0][2],out_of_range);
1539 CHECK_THROW(arr2[7][3][8][1][0][2],out_of_range);
1540 CHECK_THROW(arr2[7][3][1][m1][2][0],out_of_range);
1541 CHECK_THROW(arr2[7][3][1][7][2][0],out_of_range);
1542 CHECK_THROW(arr2[7][4][1][2][m1][3],out_of_range);
1543 CHECK_THROW(arr2[7][4][1][2][6][3],out_of_range);
1544 CHECK_THROW(arr2[7][4][1][2][3][m1],out_of_range);
1545 CHECK_THROW(arr2[7][4][1][2][3][5],out_of_range);
1551 CHECK_EQUAL(712344,arr2[7][1][2][3][4][4]);
1555 CHECK(arr2.empty());
1558 CHECK(arr4.empty());
1561 TEST_FIXTURE(LongInt6DFixtureCType,TestCopyOperatorCType)
1564 CHECK( arr.size() != arr2.size() );
1566 CHECK_EQUAL(0,arr2[0][1][2][3][4][5]);
1568 CHECK( arr.size() == arr2.size() );
1569 for (
int i=0; i<10; ++i)
1570 for (
int j=0; j<9; ++j)
1571 for (
int k=0; k<8; ++k)
1572 for (
int l=0; l<7; ++l)
1573 for (
int m=0; m<6; ++m)
1574 for (
int n=0; n<5; ++n)
1576 long z = i*100000+j*10000+k*1000+l*100+m*10+n;
1577 CHECK_EQUAL(z,arr2[i][j][k][l][m][n]);
1584 CHECK_EQUAL(712344,arr2[7][1][2][3][4][4]);
1588 CHECK(arr2.empty());
1591 CHECK(arr4.empty());
1594 TEST_FIXTURE(LongInt6DFixtureCTypeBC,TestCopyOperatorCTypeBC)
1597 CHECK( arr.size() != arr2.size() );
1599 CHECK_EQUAL(0,arr2[0][1][2][3][4][5]);
1601 CHECK( arr.size() == arr2.size() );
1602 for (
int i=0; i<10; ++i)
1603 for (
int j=0; j<9; ++j)
1604 for (
int k=0; k<8; ++k)
1605 for (
int l=0; l<7; ++l)
1606 for (
int m=0; m<6; ++m)
1607 for (
int n=0; n<5; ++n)
1609 long z = i*100000+j*10000+k*1000+l*100+m*10+n;
1610 CHECK_EQUAL(z,arr2[i][j][k][l][m][n]);
1613 CHECK_THROW(arr2[m1][1][2][3][4][0],out_of_range);
1614 CHECK_THROW(arr2[10][1][2][3][4][0],out_of_range);
1615 CHECK_THROW(arr2[7][m1][3][2][4][1],out_of_range);
1616 CHECK_THROW(arr2[7][9][3][2][4][1],out_of_range);
1617 CHECK_THROW(arr2[7][3][m1][1][0][2],out_of_range);
1618 CHECK_THROW(arr2[7][3][8][1][0][2],out_of_range);
1619 CHECK_THROW(arr2[7][3][1][m1][2][0],out_of_range);
1620 CHECK_THROW(arr2[7][3][1][7][2][0],out_of_range);
1621 CHECK_THROW(arr2[7][4][1][2][m1][3],out_of_range);
1622 CHECK_THROW(arr2[7][4][1][2][6][3],out_of_range);
1623 CHECK_THROW(arr2[7][4][1][2][3][m1],out_of_range);
1624 CHECK_THROW(arr2[7][4][1][2][3][5],out_of_range);
1630 CHECK_EQUAL(712344,arr2[7][1][2][3][4][4]);
1634 CHECK(arr2.empty());
1637 CHECK(arr4.empty());
1641 TEST_FIXTURE(LongInt3DCLayoutFixture,TestCLayout)
1643 CHECK_EQUAL(0L,mytest((
long(*)[10][10])arr.data()));
1647 TEST_FIXTURE(LongInt3DCloneFixture,TestCloning)
1651 CHECK_THROW(dolly[10][0][0],out_of_range);
1652 for (
int i=0; i<10; ++i)
1654 CHECK_THROW(dolly[i][i+1][0],out_of_range);
1655 for (
int j=0; j<i+1; ++j)
1656 CHECK_THROW(dolly[i][j][j+1],out_of_range);
1661 CHECK(dolly2.empty());
1666 CHECK_EQUAL(243UL,arr3.
size());
1670 TEST_FIXTURE(LongInt3DCloneFixtureCType,TestCloningCType)
1674 CHECK_THROW(dolly[10][0][0],out_of_range);
1675 for (
int i=0; i<10; ++i)
1677 CHECK_THROW(dolly[i][i+1][0],out_of_range);
1678 for (
int j=0; j<i+1; ++j)
1679 CHECK_THROW(dolly[i][j][j+1],out_of_range);
1684 CHECK(dolly2.empty());
1689 CHECK_EQUAL(243UL,arr3.
size());
1692 TEST_FIXTURE(LongInt2DFixture,Test2DBeginEnd)
1694 CHECK( arr.begin(2) == arr.ptr(2,0) );
1695 CHECK( arr.end(2) == arr.ptr(2,9) );
1696 CHECK_EQUAL(20L,arr.front(2));
1697 CHECK_EQUAL(28L,arr.back(2));
1699 CHECK( carr->begin(2) == carr->ptr(2,0) );
1700 CHECK( carr->end(2) == carr->ptr(2,9) );
1701 CHECK_EQUAL(20L,carr->front(2));
1702 CHECK_EQUAL(28L,carr->back(2));
1704 TEST_FIXTURE(LongInt3DFixture,Test3DBeginEnd)
1706 CHECK( arr.begin(2,4) == arr.ptr(2,4,0) );
1707 CHECK( arr.end(2,4) == arr.ptr(2,4,8) );
1708 CHECK_EQUAL(240L,arr.front(2,4));
1709 CHECK_EQUAL(247L,arr.back(2,4));
1711 CHECK( carr->begin(2,4) == carr->ptr(2,4,0) );
1712 CHECK( carr->end(2,4) == carr->ptr(2,4,8) );
1713 CHECK_EQUAL(240L,carr->front(2,4));
1714 CHECK_EQUAL(247L,carr->back(2,4));
1716 TEST_FIXTURE(LongInt4DFixture,Test4DBeginEnd)
1718 CHECK( arr.begin(2,4,7) == arr.ptr(2,4,7,0) );
1719 CHECK( arr.end(2,4,7) == arr.ptr(2,4,7,7) );
1720 CHECK_EQUAL(2470L,arr.front(2,4,7));
1721 CHECK_EQUAL(2476L,arr.back(2,4,7));
1723 CHECK( carr->begin(2,4,7) == carr->ptr(2,4,7,0) );
1724 CHECK( carr->end(2,4,7) == carr->ptr(2,4,7,7) );
1725 CHECK_EQUAL(2470L,carr->front(2,4,7));
1726 CHECK_EQUAL(2476L,carr->back(2,4,7));
1728 TEST_FIXTURE(LongInt5DFixture,Test5DBeginEnd)
1730 CHECK( arr.begin(2,4,7,5) == arr.ptr(2,4,7,5,0) );
1731 CHECK( arr.end(2,4,7,5) == arr.ptr(2,4,7,5,6) );
1732 CHECK_EQUAL(24750L,arr.front(2,4,7,5));
1733 CHECK_EQUAL(24755L,arr.back(2,4,7,5));
1735 CHECK( carr->begin(2,4,7,5) == carr->ptr(2,4,7,5,0) );
1736 CHECK( carr->end(2,4,7,5) == carr->ptr(2,4,7,5,6) );
1737 CHECK_EQUAL(24750L,carr->front(2,4,7,5));
1738 CHECK_EQUAL(24755L,carr->back(2,4,7,5));
1740 TEST_FIXTURE(LongInt6DFixture,Test6DBeginEnd)
1742 CHECK( arr.begin(2,4,7,5,1) == arr.ptr(2,4,7,5,1,0) );
1743 CHECK( arr.end(2,4,7,5,1) == arr.ptr(2,4,7,5,1,5) );
1744 CHECK_EQUAL(247510L,arr.front(2,4,7,5,1));
1745 CHECK_EQUAL(247514L,arr.back(2,4,7,5,1));
1747 CHECK( carr->begin(2,4,7,5,1) == carr->ptr(2,4,7,5,1,0) );
1748 CHECK( carr->end(2,4,7,5,1) == carr->ptr(2,4,7,5,1,5) );
1749 CHECK_EQUAL(247510L,carr->front(2,4,7,5,1));
1750 CHECK_EQUAL(247514L,carr->back(2,4,7,5,1));
1753 TEST_FIXTURE(LongInt2DFixtureCTypeBC,Test2DBeginEndCTypeBC)
1755 CHECK( arr.begin(2) == arr.ptr(2,0) );
1756 CHECK( arr.end(2) == arr.ptr(2,9) );
1757 CHECK_EQUAL(20L,arr.front(2));
1758 CHECK_EQUAL(28L,arr.back(2));
1760 CHECK( carr->begin(2) == carr->ptr(2,0) );
1761 CHECK( carr->end(2) == carr->ptr(2,9) );
1762 CHECK_EQUAL(20L,carr->front(2));
1763 CHECK_EQUAL(28L,carr->back(2));
1765 TEST_FIXTURE(LongInt3DFixtureCTypeBC,Test3DBeginEndCTypeBC)
1767 CHECK( arr.begin(2,4) == arr.ptr(2,4,0) );
1768 CHECK( arr.end(2,4) == arr.ptr(2,4,8) );
1769 CHECK_EQUAL(240L,arr.front(2,4));
1770 CHECK_EQUAL(247L,arr.back(2,4));
1772 CHECK( carr->begin(2,4) == carr->ptr(2,4,0) );
1773 CHECK( carr->end(2,4) == carr->ptr(2,4,8) );
1774 CHECK_EQUAL(240L,carr->front(2,4));
1775 CHECK_EQUAL(247L,carr->back(2,4));
1777 TEST_FIXTURE(LongInt4DFixtureCTypeBC,Test4DBeginEndCTypeBC)
1779 CHECK( arr.begin(2,4,7) == arr.ptr(2,4,7,0) );
1780 CHECK( arr.end(2,4,7) == arr.ptr(2,4,7,7) );
1781 CHECK_EQUAL(2470L,arr.front(2,4,7));
1782 CHECK_EQUAL(2476L,arr.back(2,4,7));
1784 CHECK( carr->begin(2,4,7) == carr->ptr(2,4,7,0) );
1785 CHECK( carr->end(2,4,7) == carr->ptr(2,4,7,7) );
1786 CHECK_EQUAL(2470L,carr->front(2,4,7));
1787 CHECK_EQUAL(2476L,carr->back(2,4,7));
1789 TEST_FIXTURE(LongInt5DFixtureCTypeBC,Test5DBeginEndCTypeBC)
1791 CHECK( arr.begin(2,4,7,5) == arr.ptr(2,4,7,5,0) );
1792 CHECK( arr.end(2,4,7,5) == arr.ptr(2,4,7,5,6) );
1793 CHECK_EQUAL(24750L,arr.front(2,4,7,5));
1794 CHECK_EQUAL(24755L,arr.back(2,4,7,5));
1796 CHECK( carr->begin(2,4,7,5) == carr->ptr(2,4,7,5,0) );
1797 CHECK( carr->end(2,4,7,5) == carr->ptr(2,4,7,5,6) );
1798 CHECK_EQUAL(24750L,carr->front(2,4,7,5));
1799 CHECK_EQUAL(24755L,carr->back(2,4,7,5));
1801 TEST_FIXTURE(LongInt6DFixtureCTypeBC,Test6DBeginEndCTypeBC)
1803 CHECK( arr.begin(2,4,7,5,1) == arr.ptr(2,4,7,5,1,0) );
1804 CHECK( arr.end(2,4,7,5,1) == arr.ptr(2,4,7,5,1,5) );
1805 CHECK_EQUAL(247510L,arr.front(2,4,7,5,1));
1806 CHECK_EQUAL(247514L,arr.back(2,4,7,5,1));
1808 CHECK( carr->begin(2,4,7,5,1) == carr->ptr(2,4,7,5,1,0) );
1809 CHECK( carr->end(2,4,7,5,1) == carr->ptr(2,4,7,5,1,5) );
1810 CHECK_EQUAL(247510L,carr->front(2,4,7,5,1));
1811 CHECK_EQUAL(247514L,carr->back(2,4,7,5,1));
1815 TEST_FIXTURE(LongInt3DFixture,Test3DVarLengthArgument)
1818 sprintf( buf,
"%ld", arr[2][3][4] );
1820 sscanf( buf,
"%ld", &res );
1821 CHECK_EQUAL(234L,res);
1824 TEST_FIXTURE(LongInt3DFixtureCType,Test3DVarLengthArgumentCType)
1827 sprintf( buf,
"%ld", arr[2][3][4] );
1829 sscanf( buf,
"%ld", &res );
1830 CHECK_EQUAL(234L,res);
1833 TEST_FIXTURE(LongInt2DEmptyDim,Test2DEmptyDimIterator)
1841 TEST_FIXTURE(LongInt3DEmptyDim,Test3DEmptyDimIterator)
1849 TEST_FIXTURE(LongInt4DEmptyDim,Test4DEmptyDimIterator)
1857 TEST_FIXTURE(LongInt5DEmptyDim,Test5DEmptyDimIterator)
1865 TEST_FIXTURE(LongInt6DEmptyDim,Test6DEmptyDimIterator)
1873 TEST_FIXTURE(LongInt2DEmptyDimCType,Test2DEmptyDimIteratorCType)
1881 TEST_FIXTURE(LongInt3DEmptyDimCType,Test3DEmptyDimIteratorCType)
1889 TEST_FIXTURE(LongInt4DEmptyDimCType,Test4DEmptyDimIteratorCType)
1897 TEST_FIXTURE(LongInt5DEmptyDimCType,Test5DEmptyDimIteratorCType)
1905 TEST_FIXTURE(LongInt6DEmptyDimCType,Test6DEmptyDimIteratorCType)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
pntr - interface class to replace normal pointers
const_pntr - same as pntr, except that it replaces const pointers rather than normal pointers ...
const multi_geom< d, ALLOC > & clone() const
void reserve(size_type i1)