Skip to content

Commit

Permalink
Even more tests :D
Browse files Browse the repository at this point in the history
Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Nov 25, 2024
1 parent a6ae804 commit 339b00e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ifeq ($(strip $(DEBUG)),)
QEMU_FLAGS += -nographic
else
ASFLAGS += -g
CCFLAGS += -g
CCFLAGS += -g -D__DEBUG__
QEMU_FLAGS += -s -S
endif

Expand Down
11 changes: 7 additions & 4 deletions test/test_initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ int main(void)
extract_initrd(contents, (uint64_t)fsize, tasks);
free(contents);

printf("HERE 1: %lx\n", (uintptr_t)tasks[0].entry_addr & 0xfff);
printf("HERE 2: %lx\n", (uintptr_t)tasks[1].entry_addr & 0xfff);
printf("HERE 3: %lx\n", (uintptr_t)tasks[2].entry_addr & 0xfff);
printf("HERE 4: %lx\n", (uintptr_t)tasks[3].entry_addr & 0xfff);
#ifdef __DEBUG__
assert(((uintptr_t)tasks[0].entry_addr & 0xfff) == 0xbe8);
assert(((uintptr_t)tasks[1].entry_addr & 0xfff) == 0x5bc);
assert(((uintptr_t)tasks[2].entry_addr & 0xfff) == 0x7b4);
assert(((uintptr_t)tasks[3].entry_addr & 0xfff) == 0x180);
#else
assert(tasks[0].entry_addr);
assert(tasks[1].entry_addr);
assert(tasks[2].entry_addr);
assert(tasks[3].entry_addr);
#endif

exit(0);
}

0 comments on commit 339b00e

Please sign in to comment.