tests: remove .pal/.GO2/.KIT files after test

This commit is contained in:
Thomas Bernard 2019-12-21 21:22:57 +01:00
parent 1fba07db99
commit 24a09c1569
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -354,12 +354,29 @@ int Test_Save(void)
else if (!(formats[i].flags & FLAG_CPCO) && 0 != memcmp(context.Palette, ref->palette, (formats[i].flags & FLAG_16C) ? 16 * sizeof(T_Components) : sizeof(T_Palette))) else if (!(formats[i].flags & FLAG_CPCO) && 0 != memcmp(context.Palette, ref->palette, (formats[i].flags & FLAG_16C) ? 16 * sizeof(T_Components) : sizeof(T_Palette)))
{ {
GFX2_Log(GFX2_ERROR, "Save_%s/Load_%s: Palette mismatch\n", formats[i].name, formats[i].name); GFX2_Log(GFX2_ERROR, "Save_%s/Load_%s: Palette mismatch\n", formats[i].name, formats[i].name);
GFX2_LogHexDump(GFX2_ERROR, "ref ", (const byte *)ref->palette, 0, 48);
GFX2_LogHexDump(GFX2_ERROR, "load ", (const byte *)context.Palette, 0, 48);
ok = 0; ok = 0;
} }
else else
{ {
if (unlink(path) < 0) if (unlink(path) < 0)
perror("unlink"); perror("unlink");
if (formats[i].format == FORMAT_SCR)
{
snprintf(path, sizeof(path), "%s/%s.%s", tmpdir, "test", "pal");
if (unlink(path) < 0)
perror("unlink");
}
else if (formats[i].format == FORMAT_GOS)
{
snprintf(path, sizeof(path), "%s/%s.%s", tmpdir, "test", "GO2");
if (unlink(path) < 0)
perror("unlink");
snprintf(path, sizeof(path), "%s/%s.%s", tmpdir, "test", "KIT");
if (unlink(path) < 0)
perror("unlink");
}
} }
Free_GFX2_Surface(context.Surface); Free_GFX2_Surface(context.Surface);
context.Surface = NULL; context.Surface = NULL;