-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathunittest.cpp
More file actions
54 lines (39 loc) · 1.02 KB
/
Copy pathunittest.cpp
File metadata and controls
54 lines (39 loc) · 1.02 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
// unittest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "../encrypted_value.hpp"
#include "gtest/gtest.h"
TEST(encrypted_variable, create)
{
misc::encrypted_variable<int> value(10);
EXPECT_NE(10, value.value);
EXPECT_EQ(10, (int)value);
}
TEST(encrypted_variable, copy)
{
misc::encrypted_variable<int> value(1520);
misc::encrypted_variable<int> other(value);
EXPECT_EQ(1520, (int)value);
EXPECT_EQ(1520, (int)other);
}
TEST(encrypted_variable, move)
{
misc::encrypted_variable<int> value(1520);
misc::encrypted_variable<int> other;
other = std::move(value);
EXPECT_EQ(1520, (int)other);
}
TEST(encrypted_variable, assign)
{
misc::encrypted_variable<int> value(1520);
misc::encrypted_variable<int> other;
other = value;
EXPECT_EQ(1520, (int)value);
EXPECT_EQ(1520, (int)other);
}
TEST(encrypted_variable, change_value)
{
misc::encrypted_variable<int> value(999);
value = value + 1;
EXPECT_EQ(1000, (int)value);
}