aboutsummaryrefslogtreecommitdiff
path: root/c/test.cpp
diff options
context:
space:
mode:
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");
}