Skip to content

Commit

Permalink
Fix test control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Gouache committed Sep 13, 2024
1 parent 6e35189 commit 6779944
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions test/drivertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,16 @@ int test(const char *file_name_input, const char *file_name_output,
if (copy_status == kSuccess) {
printf("Copy %s to %s\n", file_name_input, file_name_output);
copy_status = copyFile(file_name_input, file_name_output, nBufferSize);
}
if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");

if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");
}
removeFile(file_name_output);
}

Expand All @@ -214,15 +215,16 @@ int test(const char *file_name_input, const char *file_name_output,
printf("Copy with fseek %s to %s ...\n", file_name_input, file_name_output);
copy_status =
copyFileWithFseek(file_name_input, file_name_output, nBufferSize);
}
if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");

if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");
}
removeFile(file_name_output);
}

Expand All @@ -232,16 +234,16 @@ int test(const char *file_name_input, const char *file_name_output,
file_name_output);
copy_status =
copyFileWithAppend(file_name_input, file_name_output, nBufferSize);
}
if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");

if (copy_status == kSuccess) {
copy_status = compareSize(file_name_output, filesize);
if (copy_status != kSuccess)
printf("File sizes are different!\n");
else
copy_status = compareFiles(file_name_local, file_name_output);
if (copy_status != kSuccess)
printf("File contents are different!\n");
}
removeFile(file_name_output);
}

Expand Down

0 comments on commit 6779944

Please sign in to comment.