aboutsummaryrefslogtreecommitdiff
path: root/c/test.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-03 15:28:56 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-03 15:28:56 +0200
commit6ae7e24675cff4ff6b808c3024f45083f35ced97 (patch)
tree2a47273f325d8367db2a8669691273f02ca83eb9 /c/test.cpp
parent2cd22c671c67deaf2c1fcb659e3262bf57552557 (diff)
downloadEpisodeBrowser-6ae7e24675cff4ff6b808c3024f45083f35ced97.tar.gz
Improve error handling.
Diffstat (limited to 'c/test.cpp')
-rw-r--r--c/test.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/c/test.cpp b/c/test.cpp
index 21f52f4..e7c23e5 100644
--- a/c/test.cpp
+++ b/c/test.cpp
@@ -112,6 +112,31 @@ TESTS
// #undef CPY
// #undef SCPY
// }
+
+ TEST(NewCfg)
+ {
+ FileView<CfgA> fv2 = FileView<CfgA>::Initialized(L"cfg2.dat", 1);
+ CfgA* a = &s_window->cfg;
+ CfgA* b = fv2+0;
+
+#define CPY(member) b->member = a->member;
+#define SCPY(member) Wcscpy(b->member, a->member);
+
+ CPY(bViewWatched);
+ CPY(bViewTVOriginal);
+ CPY(iSortCol);
+ CPY(cEp);
+ CPY(iFocus);
+ CPY(heightDlv);
+ SCPY(limitToScreenwriter);
+ SCPY(root);
+ SCPY(glob);
+ SCPY(url);
+ Swprintf(b->prefixUrl, L"http://localhost:8000/?u=");
+
+#undef CPY
+#undef SCPY
+ }
};
int RunTests(Window& window)
@@ -121,7 +146,7 @@ int RunTests(Window& window)
const Test tests[] = {
StrcpyWithSmallerDestination(),
//IO(),
- // MigrateCfg(),
+ //NewCfg(),
};
printf("Results (%llu tests):\n", sizeof(tests)/sizeof(*tests));