aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-25 07:35:35 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-25 07:45:26 +0100
commitea542e18e7bc7e9d401aefd044bf0317676867ca (patch)
treeed8fda560fb8c4d04a9e4633d17c35c384ca8fd9 /test
parent51ec9306dce1684e35ebdcbf2f091359971fcc57 (diff)
downloadfbos-ea542e18e7bc7e9d401aefd044bf0317676867ca.tar.gz
fbos-ea542e18e7bc7e9d401aefd044bf0317676867ca.zip
tests: Only test initrd addresses on debug
In initrd tests, and in general, we only need to check that the function did something. As in, that it set the entry addresses somewhere and did not leave them NULL. This is going to be performed from now on on CI and regular tests. And, just if you want to go the extra mile, we will run specific tests that check on memory addresses but that are not guaranteed to work. This is to be replaced in the future by having some proper debugging output. As in, having a message at kernel boot time specifying the addresses being used among other info. This needs a more complex printk utility, of course. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_initrd.c15
1 files changed, 11 insertions, 4 deletions
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);
}