From 246fd1369dce903dad48730478bebbe9733ac88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 15 Aug 2022 22:24:31 +0200 Subject: 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. --- c/test.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'c/test.cpp') diff --git a/c/test.cpp b/c/test.cpp index 9230974..67a32c9 100644 --- a/c/test.cpp +++ b/c/test.cpp @@ -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)); -- cgit v1.2.3