diff options
| -rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | test/test_initrd.c | 15 |
3 files changed, 13 insertions, 6 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e278d5f..64d403e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,5 @@ jobs: - name: Lint run: make lint V=1 - - name: Check that it builds + - name: Build and run unit tests run: make V=1 @@ -49,7 +49,7 @@ ifeq ($(strip $(DEBUG)),) QEMU_FLAGS += -nographic else ASFLAGS += -g - CCFLAGS += -g + CCFLAGS += -g -D__DEBUG__ QEMU_FLAGS += -s -S endif diff --git a/test/test_initrd.c b/test/test_initrd.c index 7c23acc..314bd25 100644 --- a/test/test_initrd.c +++ b/test/test_initrd.c @@ -33,10 +33,17 @@ int main(void) extract_initrd(contents, (uint64_t)fsize, tasks); free(contents); - assert(((uintptr_t)tasks[0].entry_addr & 0xff) == 0xe8); - assert(((uintptr_t)tasks[1].entry_addr & 0xff) == 0xbc); - assert(((uintptr_t)tasks[2].entry_addr & 0xff) == 0xb4); - assert(((uintptr_t)tasks[3].entry_addr & 0xff) == 0x80); +#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); } |
