diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-10-02 19:44:32 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-10-02 19:44:32 +0000 |
commit | b72209102f864145144e185b583dd68916e8e45b (patch) | |
tree | dc5a752ef86e047e88bec1270ac521592b613e0a /lldb/gtest/unittest/Plugins/Process/Linux | |
parent | ee7902d3b239aae0507e055369768caa2eef6bcb (diff) | |
download | bcm5719-llvm-b72209102f864145144e185b583dd68916e8e45b.tar.gz bcm5719-llvm-b72209102f864145144e185b583dd68916e8e45b.zip |
thread state coordinator: add tests and impl to error on creation/death issues.
Added tests and impl to make sure the following errors are reported:
* Notifying a created thread that we are already tracking.
* Notifying a thread death for a thread we don't know about.
llvm-svn: 218900
Diffstat (limited to 'lldb/gtest/unittest/Plugins/Process/Linux')
-rw-r--r-- | lldb/gtest/unittest/Plugins/Process/Linux/ThreadStateCoordinatorTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/gtest/unittest/Plugins/Process/Linux/ThreadStateCoordinatorTest.cpp b/lldb/gtest/unittest/Plugins/Process/Linux/ThreadStateCoordinatorTest.cpp index a6bc40fd622..e35c73f29e4 100644 --- a/lldb/gtest/unittest/Plugins/Process/Linux/ThreadStateCoordinatorTest.cpp +++ b/lldb/gtest/unittest/Plugins/Process/Linux/ThreadStateCoordinatorTest.cpp @@ -205,6 +205,26 @@ TEST_F (ThreadStateCoordinatorTest, StopCoordinatorWorksNoPriorEvents) ASSERT_EQ (false, HasError ()); } +TEST_F (ThreadStateCoordinatorTest, NotifyThreadCreateSignalsErrorOnAlreadyKnownThread) +{ + // Let the coordinator know about our thread. + SetupKnownStoppedThread (TRIGGERING_TID); + + // Notify an unknown thread has stopped. + NotifyThreadCreate (TRIGGERING_TID, true); + ASSERT_PROCESS_NEXT_EVENT_FAILS (); +} + + +TEST_F (ThreadStateCoordinatorTest, NotifyThreadDeathSignalsErrorOnUnknownThread) +{ + const lldb::tid_t UNKNOWN_TID = 678; + + // Notify an unknown thread has stopped. + NotifyThreadDeath (UNKNOWN_TID); + ASSERT_PROCESS_NEXT_EVENT_FAILS (); +} + TEST_F (ThreadStateCoordinatorTest, NotifyThreadStopSignalsErrorOnUnknownThread) { const lldb::tid_t UNKNOWN_TID = 678; |