|
|
@ -1,5 +1,6 @@ |
|
|
|
#include <thread> |
|
|
|
#include <algorithm> |
|
|
|
#include <unordered_set> |
|
|
|
#include "all_cases.h" |
|
|
|
#include "common_code.h" |
|
|
|
#include "gtest/gtest.h" |
|
|
@ -22,6 +23,11 @@ static inline void SHOULD_PANIC(const std::function<void()> &func) { |
|
|
|
EXPECT_EQ(panic_flag, true); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(CommonCode, hash) { |
|
|
|
auto tmp = std::unordered_set<CommonCode>{ CommonCode(TEST_CODE) }; |
|
|
|
EXPECT_EQ(tmp.size(), 1); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(CommonCode, validity) { |
|
|
|
EXPECT_NE(CommonCode::check(0x3'A9'BF'0C'00), true); // invalid 2x2 block
|
|
|
|
EXPECT_NE(CommonCode::check(0x1'D9'BF'0C'00), true); // invalid block range
|
|
|
|