From 6ae7e24675cff4ff6b808c3024f45083f35ced97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 3 Sep 2022 15:28:56 +0200 Subject: Improve error handling. --- c/test.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'c/test.cpp') 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 fv2 = FileView::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)); -- cgit v1.2.3