mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-11 10:39:59 +00:00
Merge pull request #12737 from nlebeck/settingshandler-split
Eliminate SettingsHandler's `SetBytes` and `Reset` methods
This commit is contained in:
commit
2c91367429
5 changed files with 14 additions and 57 deletions
|
@ -75,35 +75,11 @@ TEST(SettingsHandlerTest, DecryptMultipleSettings)
|
|||
EXPECT_EQ(handler.GetValue("foo"), "bar");
|
||||
}
|
||||
|
||||
TEST(SettingsHandlerTest, SetBytesOverwritesExistingBuffer)
|
||||
{
|
||||
Common::SettingsHandler handler(BUFFER_A);
|
||||
ASSERT_EQ(handler.GetValue("key"), "val");
|
||||
ASSERT_EQ(handler.GetValue("foo"), "");
|
||||
|
||||
handler.SetBytes(BUFFER_B);
|
||||
EXPECT_EQ(handler.GetValue("foo"), "bar");
|
||||
EXPECT_EQ(handler.GetValue("key"), "");
|
||||
}
|
||||
|
||||
TEST(SettingsHandlerTest, GetValueOnSameInstance)
|
||||
{
|
||||
Common::SettingsHandler handler;
|
||||
handler.AddSetting("key", "val");
|
||||
EXPECT_EQ(handler.GetValue("key"), "");
|
||||
|
||||
Common::SettingsHandler::Buffer buffer = handler.GetBytes();
|
||||
handler.SetBytes(buffer);
|
||||
EXPECT_EQ(handler.GetValue("key"), "val");
|
||||
}
|
||||
|
||||
TEST(SettingsHandlerTest, GetValueAfterReset)
|
||||
{
|
||||
Common::SettingsHandler handler(BUFFER_A);
|
||||
ASSERT_EQ(handler.GetValue("key"), "val");
|
||||
|
||||
handler.Reset();
|
||||
EXPECT_EQ(handler.GetValue("key"), "");
|
||||
}
|
||||
|
||||
TEST(SettingsHandlerTest, EncryptAddsLFOnNullChar)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue