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
288 288
289#else289#else
290#include <tcclib.h>290#include <tcclib.h>
291
292unsigned int sleep(unsigned int seconds);
293
291int fib(n)294int fib(n)
292{295{
293 return (n <= 2) ? 1 : fib(n-1) + fib(n-2);296 return (n <= 2) ? 1 : fib(n-1) + fib(n-2);
@@ -295,7 +298,8 @@ int fib(n) · 1 unmodified line
295 298
296int main(int argc, char **argv)299int main(int argc, char **argv)
297{300{
298 printf(" %d", fib(atoi(argv[1]), 2));301 sleep(1);
302 printf(" %d", fib(atoi(argv[1])));
299 return 0;303 return 0;
300}304}
301#endif305#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