Test case added
All checks were successful
continuous-integration/drone Build is passing

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
Balazs Toldi 2023-05-30 08:23:33 +02:00
parent 6336b69e8e
commit 5dfbd15c33
Signed by: Bazsalanszky
GPG key ID: 6C7D440036F99D58
3 changed files with 11 additions and 3 deletions

12
caff.c
View file

@ -61,8 +61,16 @@ CAFF *caff_parse_file(const char *filename)
{
uint8_t id;
uint64_t length;
fread(&id, sizeof(uint8_t), 1, file);
fread(&length, sizeof(uint64_t), 1, file);
if(fread(&id, sizeof(uint8_t), 1, file) != 1 ||
fread(&length, sizeof(uint64_t), 1, file) != 1){
printf("Failed to read block id/length!\n");
fclose(file);
if(anim_count == 0){
free(caff);
caff = NULL;
}
return caff;
}
switch (id)
{

2
test.c
View file

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#define TEST_COUNT 8
#define TEST_COUNT 9
#define COMMAND_SIZE 128
int main(void)

0
test_cases/9.caff Normal file
View file