diff options
Diffstat (limited to 'c/test.cpp')
-rw-r--r-- | c/test.cpp | 64 |
1 files changed, 4 insertions, 60 deletions
@@ -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(), }; |