-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_version.cpp
More file actions
60 lines (44 loc) · 1.77 KB
/
test_version.cpp
File metadata and controls
60 lines (44 loc) · 1.77 KB
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
53
54
55
56
57
58
59
60
/*
* This file is part of the headcode.space mem.
*
* The 'LICENSE.txt' file in the project root holds the software license.
* Copyright (C) 2020-2021 headcode.space e.U.
* Oliver Maurhart <info@headcode.space>, https://www.headcode.space
*/
#include <gtest/gtest.h>
#include <headcode/mem/version.hpp>
TEST(Version, regular) {
std::uint32_t version = MAKE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
EXPECT_EQ(headcode::mem::GetCurrentVersion(), version);
EXPECT_STREQ(headcode::mem::GetVersionString().c_str(), VERSION);
}
TEST(Version, V1_1_0) {
std::uint32_t version = MAKE_VERSION(1, 1, 0);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (0)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_0(), version);
}
TEST(Version, V1_1_1) {
std::uint32_t version = MAKE_VERSION(1, 1, 1);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (1)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_1(), version);
}
TEST(Version, V1_1_2) {
std::uint32_t version = MAKE_VERSION(1, 1, 2);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (2)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_2(), version);
}
TEST(Version, V1_1_3) {
std::uint32_t version = MAKE_VERSION(1, 1, 3);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (3)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_3(), version);
}
TEST(Version, V1_1_4) {
std::uint32_t version = MAKE_VERSION(1, 1, 4);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (4)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_4(), version);
}
TEST(Version, V1_1_5) {
std::uint32_t version = MAKE_VERSION(1, 1, 5);
EXPECT_EQ(static_cast<unsigned int>((1) << 24 | (1) << 16 | (5)), version);
EXPECT_EQ(GetHCSMemVersion_1_1_5(), version);
}