Commit 2fbcb22d authored by Pavel Vainerman's avatar Pavel Vainerman

Попытка сделать тест CallBackTimer более стабильным в работе.

parent 717febcb
#include <catch.hpp> #include <catch.hpp>
#include <atomic>
#include "CallbackTimer.h" #include "CallbackTimer.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
using namespace std; using namespace std;
...@@ -25,9 +27,9 @@ class MyTestClass ...@@ -25,9 +27,9 @@ class MyTestClass
inline int getNum3(){ return num3; } inline int getNum3(){ return num3; }
private: private:
int num1; std::atomic_int num1;
int num2; std::atomic_int num2;
int num3; std::atomic_int num3;
}; };
TEST_CASE("CallbackTimer", "[CallbackTimer]" ) TEST_CASE("CallbackTimer", "[CallbackTimer]" )
...@@ -48,7 +50,7 @@ TEST_CASE("CallbackTimer", "[CallbackTimer]" ) ...@@ -48,7 +50,7 @@ TEST_CASE("CallbackTimer", "[CallbackTimer]" )
REQUIRE( tc.getNum3() == 0 ); REQUIRE( tc.getNum3() == 0 );
msleep(110); msleep(110);
REQUIRE( tc.getNum1() >= 3 ); REQUIRE( tc.getNum1() >= 2 );
REQUIRE( tc.getNum2() >= 1 ); REQUIRE( tc.getNum2() >= 1 );
REQUIRE( tc.getNum3() == 0 ); REQUIRE( tc.getNum3() == 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment