diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-16 16:09:51 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-16 16:09:51 +0200 |
commit | 8351d4c42c76584415e02a40d41f497a8f042c72 (patch) | |
tree | 6df66783c16130f943c78a8e09d6dfa2ef0359fe /c/test.cpp | |
parent | ab621173afc918797a4ea68b5d6ceee7cc043f72 (diff) | |
download | EpisodeBrowser-8351d4c42c76584415e02a40d41f497a8f042c72.tar.gz |
EpisodeListView: Use FileView consistently.
Diffstat (limited to 'c/test.cpp')
-rw-r--r-- | c/test.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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<unsigned char*>(static_cast<ElvDataA*>(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<unsigned char*>(static_cast<ElvDataA*>(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<ElvDataA*>(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"); } |