Statistics
| Revision:

root / trunk / tests / gtests / test_lvector.cpp @ 1581

History | View | Annotate | Download (455 Bytes)

1 1147 johnoel
#include <gtest/gtest.h>
2
#include <fvar.hpp>
3
4 1580 johnoel
class test_lvector: public ::testing::Test {};
5 1147 johnoel
6 1580 johnoel
TEST_F(test_lvector, constructor)
7 996 johnoel
{
8 1580 johnoel
  lvector v;
9 1581 johnoel
  EXPECT_EQ(0, v.size());
10 1157 johnoel
}
11 1580 johnoel
TEST_F(test_lvector, initialize)
12 1157 johnoel
{
13 1580 johnoel
  lvector 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 996 johnoel
}