diff options
Diffstat (limited to 'memory_replay/tests/ThreadTest.cpp')
-rw-r--r-- | memory_replay/tests/ThreadTest.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/memory_replay/tests/ThreadTest.cpp b/memory_replay/tests/ThreadTest.cpp index 4cecf189..72492905 100644 --- a/memory_replay/tests/ThreadTest.cpp +++ b/memory_replay/tests/ThreadTest.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ +#include <gtest/gtest.h> #include <pthread.h> #include <unistd.h> #include <utility> -#include <gtest/gtest.h> - +#include "Action.h" #include "Pointers.h" #include "Thread.h" @@ -99,3 +99,16 @@ TEST(ThreadTest, pointers) { thread.set_pointers(&pointers); ASSERT_TRUE(thread.pointers() == &pointers); } + +TEST(ThreadTest, action) { + Thread thread; + + Action* action = thread.CreateAction(0x1234, "thread_done", ""); + ASSERT_EQ(action, thread.GetAction()); + + // Verify the action object is not garbage. + action->Execute(nullptr); + + ASSERT_TRUE(action->EndThread()); + ASSERT_FALSE(action->DoesFree()); +} |