Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: base/threading/platform_thread_unittest.cc

Issue 9169016: mach_port_deallocate() the result of mach_thread_self(), which obtains a port send right. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Piggyback off the other test Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_unittest.cc
diff --git a/base/threading/platform_thread_unittest.cc b/base/threading/platform_thread_unittest.cc
index 6bff1d45c7ff058d2626e2296a1269aed67acacf..2170f9203d26bb14882c577e11290fad8a7176d2 100644
--- a/base/threading/platform_thread_unittest.cc
+++ b/base/threading/platform_thread_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/compiler_specific.h"
#include "base/threading/platform_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -83,6 +84,9 @@ TEST(PlatformThreadTest, Function) {
PlatformThread::Join(handle);
ASSERT_TRUE(thread.did_run());
EXPECT_NE(thread.thread_id(), main_thread_id);
+
+ // Make sure that the thread ID is the same across calls.
+ EXPECT_EQ(main_thread_id, PlatformThread::CurrentId());
}
TEST(PlatformThreadTest, FunctionTimesTen) {
@@ -101,6 +105,9 @@ TEST(PlatformThreadTest, FunctionTimesTen) {
ASSERT_TRUE(thread[n].did_run());
EXPECT_NE(thread[n].thread_id(), main_thread_id);
}
Mark Mentovai 2012/01/10 19:13:46 And maybe put a check somewhere in here to make su
Robert Sesek 2012/01/10 19:17:58 Done.
+
+ // Make sure that the thread ID is the same across calls.
+ EXPECT_EQ(main_thread_id, PlatformThread::CurrentId());
}
} // namespace base
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698