From 6fd66a9264731bd7ee6d7602675965021d929a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 24 Aug 2022 15:17:08 +0200 Subject: Remove Prolog dependency. The only thing left to reimplement is the tracking of watched episodes in MPC-HC. --- c/test.cpp | 64 ++++---------------------------------------------------------- 1 file changed, 4 insertions(+), 60 deletions(-) (limited to 'c/test.cpp') 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 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 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 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 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 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 fva(L"cfga.dat", 1); // FileView fvb = FileView::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(), }; -- cgit v1.2.3