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

Unified Diff: src/base/platform/mutex-unittest.cc

Issue 615393002: Move unit tests to test/unittests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 3 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 | « src/base/platform/condition-variable-unittest.cc ('k') | src/base/platform/platform-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/mutex-unittest.cc
diff --git a/src/base/platform/mutex-unittest.cc b/src/base/platform/mutex-unittest.cc
deleted file mode 100644
index 5af5efb5a9d68d3c6a46c4dde391bdff43ddc8b0..0000000000000000000000000000000000000000
--- a/src/base/platform/mutex-unittest.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/base/platform/mutex.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace base {
-
-TEST(Mutex, LockGuardMutex) {
- Mutex mutex;
- { LockGuard<Mutex> lock_guard(&mutex); }
- { LockGuard<Mutex> lock_guard(&mutex); }
-}
-
-
-TEST(Mutex, LockGuardRecursiveMutex) {
- RecursiveMutex recursive_mutex;
- { LockGuard<RecursiveMutex> lock_guard(&recursive_mutex); }
- {
- LockGuard<RecursiveMutex> lock_guard1(&recursive_mutex);
- LockGuard<RecursiveMutex> lock_guard2(&recursive_mutex);
- }
-}
-
-
-TEST(Mutex, LockGuardLazyMutex) {
- LazyMutex lazy_mutex = LAZY_MUTEX_INITIALIZER;
- { LockGuard<Mutex> lock_guard(lazy_mutex.Pointer()); }
- { LockGuard<Mutex> lock_guard(lazy_mutex.Pointer()); }
-}
-
-
-TEST(Mutex, LockGuardLazyRecursiveMutex) {
- LazyRecursiveMutex lazy_recursive_mutex = LAZY_RECURSIVE_MUTEX_INITIALIZER;
- { LockGuard<RecursiveMutex> lock_guard(lazy_recursive_mutex.Pointer()); }
- {
- LockGuard<RecursiveMutex> lock_guard1(lazy_recursive_mutex.Pointer());
- LockGuard<RecursiveMutex> lock_guard2(lazy_recursive_mutex.Pointer());
- }
-}
-
-
-TEST(Mutex, MultipleMutexes) {
- Mutex mutex1;
- Mutex mutex2;
- Mutex mutex3;
- // Order 1
- mutex1.Lock();
- mutex2.Lock();
- mutex3.Lock();
- mutex1.Unlock();
- mutex2.Unlock();
- mutex3.Unlock();
- // Order 2
- mutex1.Lock();
- mutex2.Lock();
- mutex3.Lock();
- mutex3.Unlock();
- mutex2.Unlock();
- mutex1.Unlock();
-}
-
-
-TEST(Mutex, MultipleRecursiveMutexes) {
- RecursiveMutex recursive_mutex1;
- RecursiveMutex recursive_mutex2;
- // Order 1
- recursive_mutex1.Lock();
- recursive_mutex2.Lock();
- EXPECT_TRUE(recursive_mutex1.TryLock());
- EXPECT_TRUE(recursive_mutex2.TryLock());
- recursive_mutex1.Unlock();
- recursive_mutex1.Unlock();
- recursive_mutex2.Unlock();
- recursive_mutex2.Unlock();
- // Order 2
- recursive_mutex1.Lock();
- EXPECT_TRUE(recursive_mutex1.TryLock());
- recursive_mutex2.Lock();
- EXPECT_TRUE(recursive_mutex2.TryLock());
- recursive_mutex2.Unlock();
- recursive_mutex1.Unlock();
- recursive_mutex2.Unlock();
- recursive_mutex1.Unlock();
-}
-
-} // namespace base
-} // namespace v8
« no previous file with comments | « src/base/platform/condition-variable-unittest.cc ('k') | src/base/platform/platform-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698