13 #include <gtest/gtest.h>
14 #include "../../include/ecl/containers/array.hpp"
30 TEST(ArrayMemCheckTests,constructors) {
32 EXPECT_EQ(3,array1[0]);
33 EXPECT_EQ(3,array1[1]);
34 EXPECT_EQ(3,array1[2]);
35 EXPECT_EQ(3,array1[3]);
37 EXPECT_EQ(4,array2[0]);
38 EXPECT_EQ(4,array2[1]);
39 EXPECT_EQ(4,array2[2]);
40 EXPECT_EQ(4,array2[3]);
42 EXPECT_EQ(3,array3[0]);
43 EXPECT_EQ(3,array3[1]);
44 EXPECT_EQ(3,array3[2]);
45 EXPECT_EQ(3,array3[3]);
48 EXPECT_EQ(3,darray1[0]);
49 EXPECT_EQ(3,darray1[1]);
50 EXPECT_EQ(3,darray1[2]);
51 EXPECT_EQ(3,darray1[3]);
55 TEST(ArrayMemCheckTests,copyConstructors) {
63 EXPECT_EQ(3,array2[0]);
64 EXPECT_EQ(3,array2[1]);
65 EXPECT_EQ(3,array2[2]);
66 EXPECT_EQ(3,array2[3]);
68 EXPECT_EQ(3,darray2[0]);
69 EXPECT_EQ(3,darray2[1]);
70 EXPECT_EQ(3,darray2[2]);
71 EXPECT_EQ(3,darray2[3]);
74 TEST(ArrayMemCheckTests,blueprintAssignment) {
79 EXPECT_EQ(3,array[0]);
80 EXPECT_EQ(3,array[1]);
81 EXPECT_EQ(3,array[2]);
82 EXPECT_EQ(3,array[3]);
84 TEST(ArrayMemCheckTests,commaInitialisation) {
91 EXPECT_EQ(1,array[0]);
92 EXPECT_EQ(2,array[1]);
93 EXPECT_EQ(3,array[2]);
94 EXPECT_EQ(4,array[3]);
96 EXPECT_EQ(1,darray[0]);
97 EXPECT_EQ(2,darray[1]);
98 EXPECT_EQ(3,darray[2]);
99 EXPECT_EQ(4,darray[3]);
101 TEST(ArrayMemCheckTests,Accessors) {
119 TEST(ArrayMemCheckTests,rangeChecking) {
141 TEST(ArrayMemCheckTests,iterators) {
145 for ( iterator = array.
begin(); iterator != array.
end(); ++iterator ) {
146 EXPECT_EQ(3,*iterator);
150 TEST(ArrayMemCheckTests,resize) {
153 darray << 0,1,2,3,4,5,6,7,8,9;
156 for ( iterator = darray.
begin(); iterator != darray.
end(); ++iterator ) {
157 EXPECT_EQ(i,*iterator);
163 TEST(ArrayMemCheckTests,concepts) {
174 int main(
int argc,
char **argv) {
176 testing::InitGoogleTest(&argc,argv);
177 return RUN_ALL_TESTS();