aboutsummaryrefslogtreecommitdiff
path: root/c/test.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-15 22:24:31 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-15 22:24:31 +0200
commit246fd1369dce903dad48730478bebbe9733ac88e (patch)
tree50a6dc779453ef430a13fd13c9ca21a4d2c3f2a1 /c/test.cpp
parent8877627ee3fcd5a8f0ce2fcccec7688973e9cb2d (diff)
downloadEpisodeBrowser-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.cpp25
1 files changed, 25 insertions, 0 deletions
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));