diff options
Diffstat (limited to 'adb/sysdeps_test.cpp')
-rw-r--r-- | adb/sysdeps_test.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/adb/sysdeps_test.cpp b/adb/sysdeps_test.cpp index 24a0d6f06..e6037d7a1 100644 --- a/adb/sysdeps_test.cpp +++ b/adb/sysdeps_test.cpp @@ -20,10 +20,9 @@ #include "sysdeps.h" -static void* increment_atomic_int(void* c) { +static void increment_atomic_int(void* c) { sleep(1); reinterpret_cast<std::atomic<int>*>(c)->fetch_add(1); - return nullptr; } TEST(sysdeps_thread, smoke) { @@ -57,3 +56,14 @@ TEST(sysdeps_thread, join) { ASSERT_EQ(500, counter.load()); } + +TEST(sysdeps_thread, exit) { + adb_thread_t thread; + ASSERT_TRUE(adb_thread_create( + [](void*) { + adb_thread_exit(); + for (;;) continue; + }, + nullptr, &thread)); + ASSERT_TRUE(adb_thread_join(thread)); +} |