History

Fix libtcc_test_mt

The test failed because atexit/on_exit code was not correct. Make it look more like the g_exit_context. Added a sleep to libtcc_test_mt to allow overlap of threads to detect this problem.

herman ten brugge committed 3 years ago

Commit 85b27431 parent e2db3a52 files · +39 −21Browse files

Showing the changes to tests (1 of 2 files). Show all

Unified · Split

tests/libtcc_test_mt.c+5−1
@@ -288,6 +288,9 @@ int main(int argc, char **argv) · 287 unmodified lines
288288
289289 #else
290290 #include <tcclib.h>
291+
292+unsigned int sleep(unsigned int seconds);
293+
291294 int fib(n)
292295 {
293296 return (n <= 2) ? 1 : fib(n-1) + fib(n-2);
@@ -295,7 +298,8 @@ int fib(n) · 1 unmodified line
295298
296299 int main(int argc, char **argv)
297300 {
298− printf(" %d", fib(atoi(argv[1]), 2));
301+ sleep(1);
302+ printf(" %d", fib(atoi(argv[1])));
299303 return 0;
300304 }
301305 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t