code format

This commit is contained in:
2022-12-14 14:13:52 +03:00
parent 430a41fefc
commit c2b8a8d6da
297 changed files with 27331 additions and 24162 deletions

View File

@@ -1,13 +1,15 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "piconditionvar.h"
#include "pithread.h"
#include "testutil.h"
class ConditionLock : public ::testing::Test, public TestUtil {
#include "gmock/gmock.h"
#include "gtest/gtest.h"
class ConditionLock
: public ::testing::Test
, public TestUtil {
public:
PIMutex* m = new PIMutex();
PIMutex * m = new PIMutex();
bool isProtect;
bool isReleased;
};
@@ -16,13 +18,12 @@ public:
TEST_F(ConditionLock, DISABLED_lock_is_protect) {
m->lock();
isProtect = true;
createThread([&](){
createThread([&]() {
m->lock();
isProtect = false;
});
EXPECT_FALSE(thread->waitForFinish(WAIT_THREAD_TIME_MS));
ASSERT_TRUE(isProtect);
}
TEST_F(ConditionLock, DISABLED_unlock_is_release) {
@@ -30,7 +31,7 @@ TEST_F(ConditionLock, DISABLED_unlock_is_release) {
isReleased = false;
m->unlock();
createThread([&](){
createThread([&]() {
m->lock();
isReleased = true;
m->unlock();
@@ -39,7 +40,7 @@ TEST_F(ConditionLock, DISABLED_unlock_is_release) {
}
TEST_F(ConditionLock, tryLock_is_false_when_locked) {
createThread([&](){
createThread([&]() {
m->lock();
piMSleep(WAIT_THREAD_TIME_MS);
});