From 8351d4c42c76584415e02a40d41f497a8f042c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 16 Aug 2022 16:09:51 +0200 Subject: EpisodeListView: Use FileView consistently. --- c/test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'c/test.cpp') diff --git a/c/test.cpp b/c/test.cpp index 9402eed..cecc408 100644 --- a/c/test.cpp +++ b/c/test.cpp @@ -56,7 +56,7 @@ TESTS { FileView fv{L"tmp.dat", sizeof(ElvDataA)*2}; Write(fv, e1_0); - Write(fv+sizeof(ElvDataA), e2_0); + Write(reinterpret_cast(static_cast(fv)+1), e2_0); } { FileView fv{L"tmp.dat", sizeof(ElvDataA)}; @@ -76,7 +76,7 @@ TESTS } { FileView fv{L"tmp.dat", sizeof(ElvDataA)*2}; - ElvDataA* e2 = Read(fv+sizeof(ElvDataA)); + ElvDataA* e2 = Read(reinterpret_cast(static_cast(fv)+1)); if (e2_0.rating != e2->rating) FAIL("rating is different (%d/%d)", e2_0.rating, e2->rating); if (e2_0.bWatched != e2->bWatched) @@ -100,7 +100,7 @@ TESTS return; { - FileView fv{L"tmp.dat", sizeof(ElvDataA)*cEp}; + FileView fv{L"tmp.dat", sizeof(ElvDataA)*8192}; unsigned char* p = fv; for (int iEp = 1; iEp <= cEp; iEp++) { @@ -111,9 +111,9 @@ TESTS } } { - FileView fv{L"tmp.dat", sizeof(ElvDataA)*cEp}; + FileView fv{L"tmp.dat", sizeof(ElvDataA)*8192}; ElvDataA* ve = reinterpret_cast(fv.view); - ElvDataA e = ve[9]; + ElvDataA& e = ve[9]; if (wcscmp(e.title, L"Pro Soccer Player Blackmail Case") != 0) FAIL("title is not correct"); } -- cgit v1.2.3