aboutsummaryrefslogtreecommitdiff
path: root/c/test.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-24 15:17:08 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-24 15:17:33 +0200
commit6fd66a9264731bd7ee6d7602675965021d929a4a (patch)
treee94fc63efb823ad2f5c9ef6de6188da389a08d38 /c/test.cpp
parentff48d644a45dd71098ecb9007a41807fb37d0081 (diff)
downloadEpisodeBrowser-6fd66a9264731bd7ee6d7602675965021d929a4a.tar.gz
Remove Prolog dependency.
The only thing left to reimplement is the tracking of watched episodes in MPC-HC.
Diffstat (limited to 'c/test.cpp')
-rw-r--r--c/test.cpp64
1 files changed, 4 insertions, 60 deletions
diff --git a/c/test.cpp b/c/test.cpp
index 0f59af4..6e291c7 100644
--- a/c/test.cpp
+++ b/c/test.cpp
@@ -4,7 +4,6 @@
#include "data.h"
#include "episodelistview.h"
#include "ext.h"
-#include "pl.h"
#include "util.h"
#include "win.h"
@@ -36,9 +35,9 @@ TESTS
TEST(IO)
{
- ElvDataA e1_0, e2_0;
- FromProlog(6, e1_0);
- FromProlog(10, e2_0);
+ extern FileView<ElvDataA> g_fvElv;
+ ElvDataA& e1_0 = g_fvElv.At(5);
+ ElvDataA& e2_0 = g_fvElv.At(9);
/* Write two ElvDataA structs to disk. */
{
@@ -89,63 +88,10 @@ TESTS
//DeleteFile(L"tmp.dat");
}
- TEST(MigrateElvDataFromPrologToDisk)
- {
- int cEp;
- if (!Pl("episode_data","episode_count",&cEp))
- return;
-
- {
- FileView<ElvDataA> fv(L"tmp.dat", g_cfg.cEp+128u);
- ElvDataA* p = fv;
-
- for (int iEp = 1; iEp <= cEp; iEp++) {
- ElvDataA e;
- FromProlog(iEp, e);
- memcpy(p, &e, sizeof(e));
- p++;
- }
- }
- {
- FileView<ElvDataA> fv(L"tmp.dat", g_cfg.cEp+128u);
- ElvDataA& e = fv.At(9);
- if (wcscmp(e.title, L"Pro Soccer Player Blackmail Case") != 0)
- FAIL("title is not correct");
- }
- //DeleteFile(L"tmp.dat");
- }
-
- TEST(MigrateDlvDataFromPrologToDisk)
- {
- int cEp;
- if (!Pl("episode_data","episode_count",&cEp))
- return;
-
- {
- FileView<DlvDataA> fv(L"tmp.dat", g_cfg.cEp+128u);
- DlvDataA* p = fv;
-
- for (int iEp = 1; iEp <= cEp; iEp++) {
- DlvDataA d;
- FromProlog(iEp, d);
- memcpy(p, &d, sizeof(d));
- p++;
- }
- }
- {
- FileView<DlvDataA> fv(L"tmp.dat", g_cfg.cEp+128u);
- DlvDataA& e = fv.At(9);
- if (wcscmp(e.date, L"March 11, 1996") != 0)
- FAIL("date is not correct");
- }
- //DeleteFile(L"tmp.dat");
- }
-
// TEST(MigrateCfg)
// {
-// FileView<CfgA> fva(L"cfga.dat", 1);
// FileView<CfgB> fvb = FileView<CfgB>::Initialized(L"cfgb.dat", 1);
-// CfgA* a = fva+0;
+// CfgA* a = &g_cfg;
// CfgB* b = fvb+0;
// #define CPY(member) b->member = a->member;
@@ -172,8 +118,6 @@ int RunTests()
const Test tests[] = {
StrcpyWithSmallerDestination(),
//IO(),
- //MigrateElvDataFromPrologToDisk(),
- //MigrateDlvDataFromPrologToDisk(),
//MigrateCfg(),
};