diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-15 22:24:31 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-15 22:24:31 +0200 |
commit | 246fd1369dce903dad48730478bebbe9733ac88e (patch) | |
tree | 50a6dc779453ef430a13fd13c9ca21a4d2c3f2a1 /c/test.cpp | |
parent | 8877627ee3fcd5a8f0ce2fcccec7688973e9cb2d (diff) | |
download | EpisodeBrowser-246fd1369dce903dad48730478bebbe9733ac88e.tar.gz |
Start moving data into C++.
This is the first step in the process of getting rid of the SWI Prolog
dependency. We'll see how it goes.
Diffstat (limited to 'c/test.cpp')
-rw-r--r-- | c/test.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -23,12 +23,37 @@ TESTS if (dst[9] != 0) FAIL("dst is not NUL-terminated"); } + + TEST(EpisodeDataFromWeb) + { + ElvData e; + DlvData d; + FromWeb(10, e, d); + if (wcscmp(e.title, L"Pro Soccer Player Blackmail Case") != 0) + FAIL("title is not correct"); + if (wcscmp(d.date, L"March 11, 1996") != 0) + FAIL("date is not correct"); + } + + TEST(EpisodeDataFromProlog) + { + ElvData e; + DlvData d; + FromProlog(10, e); + FromProlog(10, d); + if (wcscmp(e.title, L"Pro Soccer Player Blackmail Case") != 0) + FAIL("title is not correct"); + if (wcscmp(d.date, L"March 11, 1996") != 0) + FAIL("date is not correct"); + } }; int RunTests() { const Test tests[] = { StrcpyWithSmallerDestination{}, + //EpisodeDataFromWeb{}, + EpisodeDataFromProlog{}, }; printf("Results (%llu tests):\n", sizeof(tests)/sizeof(*tests)); |