aboutsummaryrefslogtreecommitdiff
path: root/src/test/SaveManagerTest.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-19 19:06:00 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-19 19:06:00 +0100
commite9ff4f207572a2dd2fb588093c7d1d971e463dc0 (patch)
tree621c74431b2a4042099e3c22beee3f5383ef2cbb /src/test/SaveManagerTest.cpp
parentfa3bf171e73da70d964d85851bd20d87362fcfd2 (diff)
parentc737b01035cb62712b1dabcfef6f5014bdc882d1 (diff)
merge master
Diffstat (limited to 'src/test/SaveManagerTest.cpp')
-rw-r--r--src/test/SaveManagerTest.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/test/SaveManagerTest.cpp b/src/test/SaveManagerTest.cpp
index e9b0c29..7609e69 100644
--- a/src/test/SaveManagerTest.cpp
+++ b/src/test/SaveManagerTest.cpp
@@ -27,8 +27,8 @@ TEST_F(SaveManagerTest, ReadWrite) {
mgr.set<string>("foo", "bar");
ASSERT_TRUE(mgr.has("foo"));
- ValueBroker value = mgr.get<string>("foo");
- EXPECT_EQ(value.get(), "bar");
+ string value = mgr.get<string>("foo");
+ EXPECT_EQ(value, "bar");
}
TEST_F(SaveManagerTest, DefaultValue) {
@@ -36,5 +36,16 @@ TEST_F(SaveManagerTest, DefaultValue) {
ASSERT_EQ(value.get(), 3);
value.set(5);
- ASSERT_EQ(value.get(), 5);
+ EXPECT_EQ(value.get(), 5);
+}
+
+TEST_F(SaveManagerTest, MultipleKeys) {
+ ValueBroker foo = mgr.get<int>("foo", 1);
+ ValueBroker bar = mgr.get<int>("bar", 2);
+
+ EXPECT_EQ(foo.get(), 1);
+ EXPECT_EQ(bar.get(), 2);
+
+ EXPECT_EQ(mgr.get<int>("foo"), 1);
+ EXPECT_EQ(mgr.get<int>("bar"), 2);
}