Statistics
| Revision:

root / trunk / tests / gtests / test_ivector.cpp @ 1974

History | View | Annotate | Download (456 Bytes)

1
#include <gtest/gtest.h>
2
#include <ivector.h>
3

    
4
class test_ivector: public ::testing::Test {};
5

    
6
TEST_F(test_ivector, constructor)
7
{
8
  ivector v;
9
  EXPECT_EQ(0, v.size());
10
}
11
TEST_F(test_ivector, initialize)
12
{
13
  ivector v(1, 10);
14
  EXPECT_EQ(10, v.size());
15
  for (int i = 1; i <= 10; i++)
16
  {
17
    v(i) = i;
18
  }
19
  for (int i = 1; i <= 10; i++)
20
  {
21
    EXPECT_EQ(i, v(i));
22
  }
23
  v.initialize();
24
  for (int i = 1; i <= 10; i++)
25
  {
26
    EXPECT_EQ(0, v(i));
27
  }
28
}