about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-10-15 17:27:58 +0800
committerGitHub <noreply@github.com>2025-10-15 11:27:58 +0200
commit1d4a9e8863d7e32f0bb1472674a94f05df1409b5 (patch)
tree9190b900b57d3700fe50be1f1b43b0dc0d38fe03
parentcc68021a14b296ef0ca2816597fc9a5ea6561841 (diff)
downloadbox64-1d4a9e8863d7e32f0bb1472674a94f05df1409b5.tar.gz
box64-1d4a9e8863d7e32f0bb1472674a94f05df1409b5.zip
[TEST] Some minor fixes to the test runner (#3072)
-rw-r--r--src/test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test.c b/src/test.c
index 012fc13d..792eee89 100644
--- a/src/test.c
+++ b/src/test.c
@@ -50,7 +50,7 @@ struct {
     uint8_t data[MAX_MEMORY_DATA_SIZE];
 } memory_data[MAX_MEMORY_DATA] = { { 0 } };
 
-inline uint64_t fromstr(const char* str)
+static inline uint64_t fromstr(const char* str)
 {
     int base = strlen(str) > 2 && (str[1] == 'x' || str[1] == 'X') ? 16 : 10;
     return strtoull(str, NULL, base);
@@ -272,12 +272,13 @@ static void loadTest(const char** filepath, const char* include_path)
         waitpid(fork_result, &status, 0);
         if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
             printf_log(LOG_NONE, NASM " failed with exit code: %d\n", WEXITSTATUS(status));
+            unlink(objname);
             exit(1);
         }
     }
 
     close(mkstemp(binname));
-    const char* ld_cmd[] = { X86_64_LD, objname, "-Ttext=0x10000", "-w", "-m", box64_is32bits ? "elf_i386" : "elf_x86_64", "-o", binname, NULL };
+    const char* ld_cmd[] = { X86_64_LD, objname, "-Ttext=0x100000", "-w", "-m", box64_is32bits ? "elf_i386" : "elf_x86_64", "-o", binname, NULL };
 
     fork_result = fork();
     if (fork_result == 0) {
@@ -288,6 +289,7 @@ static void loadTest(const char** filepath, const char* include_path)
         waitpid(fork_result, &status, 0);
         if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
             printf_log(LOG_NONE, X86_64_LD " failed with exit code: %d\n", WEXITSTATUS(status));
+            unlink(objname);
             exit(1);
         }
     }