forked from schombert/Open-V2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables_test.cpp
52 lines (36 loc) · 1.7 KB
/
variables_test.cpp
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
46
47
48
49
50
51
52
#include "gtest\\gtest.h"
#include "variables\\variables.h"
using namespace variables;
TEST(variables_tests, test_global_var) {
variables_manager m;
const auto r = m.get_named_global_variable(text_data::text_tag(0));
EXPECT_EQ(1ui32, m.count_global_variables);
EXPECT_EQ(global_variable_tag(0), r);
EXPECT_EQ(global_variable_tag(0), m.named_global_variables[text_data::text_tag(0)]);
const auto r2 = m.get_named_global_variable(text_data::text_tag(1));
EXPECT_EQ(2ui32, m.count_global_variables);
EXPECT_EQ(global_variable_tag(1), r2);
EXPECT_EQ(global_variable_tag(1), m.named_global_variables[text_data::text_tag(1)]);
}
TEST(variables_tests, test_national_var) {
variables_manager m;
const auto r = m.get_named_national_variable(text_data::text_tag(0));
EXPECT_EQ(1ui32, m.count_national_variables);
EXPECT_EQ(national_variable_tag(0), r);
EXPECT_EQ(national_variable_tag(0), m.named_national_variables[text_data::text_tag(0)]);
const auto r2 = m.get_named_national_variable(text_data::text_tag(1));
EXPECT_EQ(2ui32, m.count_national_variables);
EXPECT_EQ(national_variable_tag(1), r2);
EXPECT_EQ(national_variable_tag(1), m.named_national_variables[text_data::text_tag(1)]);
}
TEST(variables_tests, test_national_flag) {
variables_manager m;
const auto r = m.get_named_national_flag(text_data::text_tag(0));
EXPECT_EQ(1ui32, m.count_national_flags);
EXPECT_EQ(national_flag_tag(0), r);
EXPECT_EQ(national_flag_tag(0), m.named_national_flags[text_data::text_tag(0)]);
const auto r2 = m.get_named_national_flag(text_data::text_tag(1));
EXPECT_EQ(2ui32, m.count_national_flags);
EXPECT_EQ(national_flag_tag(1), r2);
EXPECT_EQ(national_flag_tag(1), m.named_national_flags[text_data::text_tag(1)]);
}