Revision 1629

trunk/tests/gtests/Makefile (revision 1629)
12 12
 scalefactor.obj\
13 13
 test_option_match.cpp\
14 14
 test_lvector.cpp\
15
 test_adjson.cpp\
16
 test_df3_two_variable.cpp\
15 17
 main.cpp
16 18

  
17 19
# test_df_file.cpp\
trunk/tests/gtests/test_df3_two_variable.cpp (revision 1629)
1
#include <gtest/gtest.h>
2
#include <df3_two_variable.h>
3

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

  
6
TEST_F(test_df3_two_variable, constructor)
7
{
8
  df3_two_variable v;
9
  ASSERT_EQ(0, *v.get_u());
10
  ASSERT_EQ(0, *v.get_u_x());
11
  ASSERT_EQ(0, *v.get_u_y());
12
  ASSERT_EQ(0, *v.get_u_xx());
13
  ASSERT_EQ(0, *v.get_u_xy());
14
  ASSERT_EQ(0, *v.get_u_yy());
15
  ASSERT_EQ(0, *v.get_u_xxx());
16
  ASSERT_EQ(0, *v.get_u_xxy());
17
  ASSERT_EQ(0, *v.get_u_xyy());
18
  ASSERT_EQ(0, *v.get_u_yyy());
19
}
20
TEST_F(test_df3_two_variable, operator_equal_double)
21
{
22
  df3_two_variable v;
23
  v = 5;
24
  ASSERT_EQ(5, *v.get_u());
25
  ASSERT_EQ(0, *v.get_u_x());
26
  ASSERT_EQ(0, *v.get_u_y());
27
  ASSERT_EQ(0, *v.get_u_xx());
28
  ASSERT_EQ(0, *v.get_u_xy());
29
  ASSERT_EQ(0, *v.get_u_yy());
30
  ASSERT_EQ(0, *v.get_u_xxx());
31
  ASSERT_EQ(0, *v.get_u_xxy());
32
  ASSERT_EQ(0, *v.get_u_xyy());
33
  ASSERT_EQ(0, *v.get_u_yyy());
34
}
35
TEST_F(test_df3_two_variable, operator_equal_df3_two_variable)
36
{
37
  df3_two_variable copy;
38
  copy = 5;
39
  df3_two_variable v;
40
  v = copy;
41
  ASSERT_EQ(5, *v.get_u());
42
  ASSERT_EQ(0, *v.get_u_x());
43
  ASSERT_EQ(0, *v.get_u_y());
44
  ASSERT_EQ(0, *v.get_u_xx());
45
  ASSERT_EQ(0, *v.get_u_xy());
46
  ASSERT_EQ(0, *v.get_u_yy());
47
  ASSERT_EQ(0, *v.get_u_xxx());
48
  ASSERT_EQ(0, *v.get_u_xxy());
49
  ASSERT_EQ(0, *v.get_u_xyy());
50
  ASSERT_EQ(0, *v.get_u_yyy());
51
}
52
TEST_F(test_df3_two_variable, copy_constructor)
53
{
54
  df3_two_variable copy;
55
  copy = 5;
56
  df3_two_variable v(copy);
57
  ASSERT_EQ(5, *v.get_u());
58
  ASSERT_EQ(0, *v.get_u_x());
59
  ASSERT_EQ(0, *v.get_u_y());
60
  ASSERT_EQ(0, *v.get_u_xx());
61
  ASSERT_EQ(0, *v.get_u_xy());
62
  ASSERT_EQ(0, *v.get_u_yy());
63
  ASSERT_EQ(0, *v.get_u_xxx());
64
  ASSERT_EQ(0, *v.get_u_xxy());
65
  ASSERT_EQ(0, *v.get_u_xyy());
66
  ASSERT_EQ(0, *v.get_u_yyy());
67
}
68
TEST_F(test_df3_two_variable, operator_plus_equal_df3_two_variable)
69
{
70
  df3_two_variable x;
71
  x = 5;
72
  df3_two_variable y;
73
  y = 2;
74
  
75
  x += y;
76
  
77
  ASSERT_EQ(7, *x.get_u());
78
  ASSERT_EQ(0, *x.get_u_x());
79
  ASSERT_EQ(0, *x.get_u_y());
80
  ASSERT_EQ(0, *x.get_u_xx());
81
  ASSERT_EQ(0, *x.get_u_xy());
82
  ASSERT_EQ(0, *x.get_u_yy());
83
  ASSERT_EQ(0, *x.get_u_xxx());
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff