Jack Grigg
7 years ago
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with
17 additions and
1 deletions
-
src/gtest/test_metrics.cpp
|
|
@ -6,7 +6,7 @@ |
|
|
|
|
|
|
|
TEST(Metrics, GetLocalSolPS) { |
|
|
|
SetMockTime(100); |
|
|
|
MarkStartTime(); |
|
|
|
miningTimer.start(); |
|
|
|
|
|
|
|
// No time has passed
|
|
|
|
EXPECT_EQ(0, GetLocalSolPS()); |
|
|
@ -27,4 +27,20 @@ TEST(Metrics, GetLocalSolPS) { |
|
|
|
solutionTargetChecks.increment(); |
|
|
|
solutionTargetChecks.increment(); |
|
|
|
EXPECT_EQ(1.5, GetLocalSolPS()); |
|
|
|
|
|
|
|
// Stop timing
|
|
|
|
miningTimer.stop(); |
|
|
|
EXPECT_EQ(1.5, GetLocalSolPS()); |
|
|
|
|
|
|
|
// Increment time
|
|
|
|
SetMockTime(103); |
|
|
|
EXPECT_EQ(1.5, GetLocalSolPS()); |
|
|
|
|
|
|
|
// Start timing again
|
|
|
|
miningTimer.start(); |
|
|
|
EXPECT_EQ(1.5, GetLocalSolPS()); |
|
|
|
|
|
|
|
// Increment time
|
|
|
|
SetMockTime(104); |
|
|
|
EXPECT_EQ(1, GetLocalSolPS()); |
|
|
|
} |
|
|
|