-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsub_class_test.h
45 lines (35 loc) · 1.06 KB
/
sub_class_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
TEST(SubclassTest, get_left_rightAddTest){
Base* one = new Op(1);
Base* two = new Op(2);
Base* add = new Add(one,two);
EXPECT_EQ(add->get_left(),one);
EXPECT_EQ(add->get_right(),two);
}
TEST(SubclassTest, get_left_rightSubTest){
Base* one = new Op(1);
Base* two = new Op(2);
Base* sub = new Sub(one,two);
EXPECT_EQ(sub->get_left(),one);
EXPECT_EQ(sub->get_right(),two);
}
TEST(SubclassTest, get_left_rightMultTest){
Base* one = new Op(1);
Base* two = new Op(2);
Base* mult = new Mult(one,two);
EXPECT_EQ(mult->get_left(),one);
EXPECT_EQ(mult->get_right(),two);
}
TEST(SubclassTest, get_left_rightDivTest){
Base* one = new Op(1);
Base* two = new Op(2);
Base* div = new Div(one,two);
EXPECT_EQ(div->get_left(),one);
EXPECT_EQ(div->get_right(),two);
}
TEST(SubclassTest, get_left_rightPowTest){
Base* one = new Op(1);
Base* two = new Op(2);
Base* pow = new Pow(one,two);
EXPECT_EQ(pow->get_left(),one);
EXPECT_EQ(pow->get_right(),two);
}