diff options
author | 2016-10-29 09:11:50 +0200 | |
---|---|---|
committer | 2016-10-29 09:11:50 +0200 | |
commit | a3b4058bf7266f1291cf38c30425d9948250fcd9 (patch) | |
tree | 46116c48b60368ac9c782c1d5e6e8ae16e558987 /3rdparty/bx/tests/thread_test.cpp | |
parent | b99be73f2db5d3f81edc96a92ac4839e7f1cc3ab (diff) |
Updated BGFX and BX and recompiled shaders (nw)
Diffstat (limited to '3rdparty/bx/tests/thread_test.cpp')
-rw-r--r-- | 3rdparty/bx/tests/thread_test.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/3rdparty/bx/tests/thread_test.cpp b/3rdparty/bx/tests/thread_test.cpp new file mode 100644 index 00000000000..f0ee772aeba --- /dev/null +++ b/3rdparty/bx/tests/thread_test.cpp @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx#license-bsd-2-clause + */ + +#include "test.h" +#include <bx/thread.h> + +int32_t threadExit0(void*) +{ + return 0; +} + +int32_t threadExit1(void*) +{ + return 1; +} + +TEST(thread) +{ + bx::Thread th; + + CHECK_EQUAL(th.isRunning(), false); + + th.init(threadExit0); + CHECK_EQUAL(th.isRunning(), true); + th.shutdown(); + + CHECK_EQUAL(th.isRunning(), false); + CHECK_EQUAL(th.getExitCode(), 0); + + th.init(threadExit1); + CHECK_EQUAL(th.isRunning(), true); + th.shutdown(); + + CHECK_EQUAL(th.isRunning(), false); + CHECK_EQUAL(th.getExitCode(), 1); +} |