aboutsummaryrefslogtreecommitdiff
path: root/c/test.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-16 16:09:51 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-16 16:09:51 +0200
commit8351d4c42c76584415e02a40d41f497a8f042c72 (patch)
tree6df66783c16130f943c78a8e09d6dfa2ef0359fe /c/test.cpp
parentab621173afc918797a4ea68b5d6ceee7cc043f72 (diff)
downloadEpisodeBrowser-8351d4c42c76584415e02a40d41f497a8f042c72.tar.gz
EpisodeListView: Use FileView consistently.
Diffstat (limited to 'c/test.cpp')
-rw-r--r--c/test.cpp10
1 files changed, 5 insertions, 5 deletions
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<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");
}