diff options
author | Alexander Kutsan <AKutsan@luxoft.com> | 2016-08-26 18:48:22 +0300 |
---|---|---|
committer | Alexander Kutsan <AKutsan@luxoft.com> | 2016-08-26 18:48:57 +0300 |
commit | d73e6dc8724c5799fae14efd4dcb214af74e4904 (patch) | |
tree | 9ebed8b422490c4d669e90e70783e4f5b55b65c9 /src/components/utils/test/rwlock_posix_test.cc | |
parent | c201c11a35d360c0b96f36b103a2590bfaeb6026 (diff) | |
parent | 61ef8c42badb879216f53d240e1101b9f83a9bb7 (diff) | |
download | sdl_core-d73e6dc8724c5799fae14efd4dcb214af74e4904.tar.gz |
Merge branch 'release/4.1.0'
Diffstat (limited to 'src/components/utils/test/rwlock_posix_test.cc')
-rw-r--r-- | src/components/utils/test/rwlock_posix_test.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/components/utils/test/rwlock_posix_test.cc b/src/components/utils/test/rwlock_posix_test.cc index 779b57ff32..6cb140f4c5 100644 --- a/src/components/utils/test/rwlock_posix_test.cc +++ b/src/components/utils/test/rwlock_posix_test.cc @@ -72,20 +72,20 @@ class RWlockTest : public ::testing::Test { } } - static void* ReadLock_helper(void *context) { - RWlockTest *temp = reinterpret_cast<RWlockTest *>(context); + static void* ReadLock_helper(void* context) { + RWlockTest* temp = reinterpret_cast<RWlockTest*>(context); temp->ReadLock(); return NULL; } - static void* TryReadLock_helper(void *context) { - RWlockTest *temp = reinterpret_cast<RWlockTest *>(context); + static void* TryReadLock_helper(void* context) { + RWlockTest* temp = reinterpret_cast<RWlockTest*>(context); temp->ExpectReadLockFail(); return NULL; } - static void* TryWriteLock_helper(void *context) { - RWlockTest *temp = reinterpret_cast<RWlockTest *>(context); + static void* TryWriteLock_helper(void* context) { + RWlockTest* temp = reinterpret_cast<RWlockTest*>(context); temp->ExpectWriteLockFail(); return NULL; } @@ -101,7 +101,8 @@ TEST_F(RWlockTest, AcquireForReading_ExpectAccessForReading) { EXPECT_TRUE(test_rwlock.AcquireForReading()); // Try to lock rw lock for reading again EXPECT_TRUE(test_rwlock.AcquireForReading()); - // Creating kNumThreads threads, starting them with callback function, waits until all of them finished + // Creating kNumThreads threads, starting them with callback function, waits + // until all of them finished ThreadsDispatcher(&RWlockTest::ReadLock_helper); // Releasing RW locks EXPECT_TRUE(test_rwlock.Release()); @@ -113,7 +114,8 @@ TEST_F(RWlockTest, AcquireForReading_ExpectNoAccessForWriting) { EXPECT_TRUE(test_rwlock.AcquireForReading()); // Try to lock rw lock for writing EXPECT_FALSE(test_rwlock.TryAcquireForWriting()); - // Creating kNumThreads threads, starting them with callback function, waits until all of them finished + // Creating kNumThreads threads, starting them with callback function, waits + // until all of them finished ThreadsDispatcher(&RWlockTest::TryWriteLock_helper); EXPECT_TRUE(test_rwlock.Release()); } @@ -123,7 +125,8 @@ TEST_F(RWlockTest, AcquireForWriting_ExpectNoAccessForReading) { EXPECT_TRUE(test_rwlock.AcquireForWriting()); // Try to lock rw lock for reading EXPECT_FALSE(test_rwlock.TryAcquireForReading()); - // Creating kNumThreads threads, starting them with callback function, waits until all of them finished + // Creating kNumThreads threads, starting them with callback function, waits + // until all of them finished ThreadsDispatcher(&RWlockTest::TryReadLock_helper); EXPECT_TRUE(test_rwlock.Release()); } @@ -133,7 +136,8 @@ TEST_F(RWlockTest, AcquireForWriting_ExpectNoMoreAccessForWriting) { EXPECT_TRUE(test_rwlock.AcquireForWriting()); // Try to lock rw lock for reading EXPECT_FALSE(test_rwlock.TryAcquireForWriting()); - // Creating kNumThreads threads, starting them with callback function, waits until all of them finished + // Creating kNumThreads threads, starting them with callback function, waits + // until all of them finished ThreadsDispatcher(&RWlockTest::TryWriteLock_helper); EXPECT_TRUE(test_rwlock.Release()); } |