MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / TEST

Function TEST

tests/host/settings/settings_store_test.cpp:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38TEST(SettingsStore, RoundTrip) {
39 const auto p = temp_file("roundtrip");
40 AppSettings s;
41 s.window_w = 800;
42 s.window_h = 600;
43 s.window_x = 40;
44 s.window_y = 30;
45 s.left_pane_w = 300.0f;
46 s.contrast_enabled = false;
47 s.link_views = true;
48 s.previous_buffers = {{"a", 111}, {"b", 222}};
49 SettingsStore{p}.save(s);
50 const AppSettings out = SettingsStore{p}.load();
51 EXPECT_EQ(out, s);
52}
53
54TEST(SettingsStore, MissingFileYieldsDefaults) {
55 EXPECT_EQ(SettingsStore{temp_file("missing")}.load(), AppSettings{});

Callers

nothing calls this directly

Calls 6

temp_fileFunction · 0.85
scratch_dirFunction · 0.85
settings_to_jsonFunction · 0.85
settings_from_jsonFunction · 0.85
saveMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected