Skip to content

Commit

Permalink
Renable to build tests on OSX and fix INSTANTIATE_TEST_CASE_P -> INST…
Browse files Browse the repository at this point in the history
…ANTIATE_TEST_SUITE_P
  • Loading branch information
Super-Genius committed Sep 27, 2023
1 parent 56ace0d commit 73891a5
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/OSX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(MULTIPLE_OPTION "-Xlink=-force:multiple")
# Set extra compiler flags
set(EXTRA_CXX_FLAGS)

set(TESTING OFF)
set(TESTING ON)

# --------------------------------------------------------
# Set custom subfolder for ABI
Expand Down
2 changes: 1 addition & 1 deletion test/src/base/hexutil_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TEST_P(UnhexNumber32Test, Unhex32Success) {
EXPECT_EQ(decimal, val);
}

INSTANTIATE_TEST_CASE_P(UnhexNumberTestCases,
INSTANTIATE_TEST_SUITE_P(UnhexNumberTestCases,
UnhexNumber32Test,
::testing::Values(makePair("0x64", 100),
makePair("0x01", 1),
Expand Down
2 changes: 1 addition & 1 deletion test/src/blockchain/block_header_repository_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ TEST_P(BlockHeaderRepository_NumberParametrized_Test, GetHeader) {
ASSERT_EQ(header_by_num, header_should_be);
}

INSTANTIATE_TEST_CASE_P(Numbers, BlockHeaderRepository_NumberParametrized_Test,
INSTANTIATE_TEST_SUITE_P(Numbers, BlockHeaderRepository_NumberParametrized_Test,
testing::ValuesIn(ParamValues));
2 changes: 1 addition & 1 deletion test/src/crypto/bip39/bip39_integration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TEST_P(Bip39IntegrationTest, DeriveEntropyAndSeedSuccess) {
ASSERT_EQ(seed.toHex(), item.seed);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
SubstrateTestCases,
Bip39IntegrationTest,
::testing::Values(
Expand Down
2 changes: 1 addition & 1 deletion test/src/crypto/crypto_store/key_type_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TEST_P(KeyTypeTest, DecodeSuccess) {
}
}

INSTANTIATE_TEST_CASE_P(KeyTypeTestCases,
INSTANTIATE_TEST_SUITE_P(KeyTypeTestCases,
KeyTypeTest,
::testing::Values(good(kProd, "prod"),
good(kGran, "gran"),
Expand Down
2 changes: 1 addition & 1 deletion test/src/scale/scale_compact_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TEST_P(CompactTest, DecodeSuccess) {
ASSERT_EQ(v, value_match);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
CompactTestCases, CompactTest,
::testing::Values(
// 0 is min compact integer value, negative values are not allowed
Expand Down
16 changes: 8 additions & 8 deletions test/src/scale/scale_fixed_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST_P(Int8Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(Int8TestCases, Int8Test,
INSTANTIATE_TEST_SUITE_P(Int8TestCases, Int8Test,
::testing::Values(Int8Test::make_pair(0, {0}),
Int8Test::make_pair(-1, {255}),
Int8Test::make_pair(-128, {128}),
Expand Down Expand Up @@ -85,7 +85,7 @@ TEST_P(Uint8Test, DecodeSuccess) {
}


INSTANTIATE_TEST_CASE_P(Uint8TestCases, Uint8Test,
INSTANTIATE_TEST_SUITE_P(Uint8TestCases, Uint8Test,
::testing::Values(Uint8Test::make_pair(0, {0}),
Uint8Test::make_pair(234, {234}),
Uint8Test::make_pair(255, {255})));
Expand Down Expand Up @@ -121,7 +121,7 @@ TEST_P(Int16Test, DecodeSuccess) {
}


INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Int16TestCases, Int16Test,
::testing::Values(Int16Test::make_pair(-32767, {1, 128}),
Int16Test::make_pair(-32768, {0, 128}),
Expand Down Expand Up @@ -160,7 +160,7 @@ TEST_P(Uint16Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Uint16TestCases, Uint16Test,
::testing::Values(Uint16Test::make_pair(32767, {255, 127}),
Uint16Test::make_pair(12345, {57, 48})));
Expand Down Expand Up @@ -195,7 +195,7 @@ TEST_P(Int32Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Int32TestCases, Int32Test,
::testing::Values(Int32Test::make_pair(2147483647l, {255, 255, 255, 127}),
Int32Test::make_pair(-1, {255, 255, 255, 255}),
Expand Down Expand Up @@ -231,7 +231,7 @@ TEST_P(Uint32Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Uint32TestCases, Uint32Test,
::testing::Values(Uint32Test::make_pair(16909060ul, {4, 3, 2, 1}),
Uint32Test::make_pair(67305985, {1, 2, 3, 4})));
Expand Down Expand Up @@ -266,7 +266,7 @@ TEST_P(Int64Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Int64TestCases, Int64Test,
::testing::Values(
Int64Test::make_pair(578437695752307201ll, {1, 2, 3, 4, 5, 6, 7, 8}),
Expand Down Expand Up @@ -302,6 +302,6 @@ TEST_P(Uint64Test, DecodeSuccess) {
ASSERT_EQ(v, value);
}

INSTANTIATE_TEST_CASE_P(Uint64TestCases, Uint64Test,
INSTANTIATE_TEST_SUITE_P(Uint64TestCases, Uint64Test,
::testing::Values(Uint64Test::make_pair(
578437695752307201ull, {1, 2, 3, 4, 5, 6, 7, 8})));
2 changes: 1 addition & 1 deletion test/src/scale/scale_variant_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST_P(VariantFixture, EncodeSuccessTest) {
ASSERT_EQ(s.data(), match);
}

INSTANTIATE_TEST_CASE_P(CompactTestCases, VariantFixture,
INSTANTIATE_TEST_SUITE_P(CompactTestCases, VariantFixture,
::testing::Values(make_pair(uint8_t(1), {0, 1}),
make_pair(uint32_t(2),
{1, 2, 0, 0, 0})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ std::vector<TrieCommand> DeleteOddKeyLengths = {
{"4f4d"_hex2buf, "stuff"_buf, Command::GET},
{"43c1"_hex2buf, "noot"_buf, Command::GET}};

INSTANTIATE_TEST_CASE_P(GolkadotSuite,
INSTANTIATE_TEST_SUITE_P(GolkadotSuite,
TrieTest,
testing::ValuesIn({PutAndGetBranch,
PutAndGetOddKeyLengths,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ const std::vector<std::pair<Buffer, Buffer>> cases = {
// buffer of size 32, consists of ones
{Buffer(32, 1), getBlake2b(Buffer(32, 1))}};

INSTANTIATE_TEST_CASE_P(SuperGeniusCodec, Hash256Test, ValuesIn(cases));
INSTANTIATE_TEST_SUITE_P(SuperGeniusCodec, Hash256Test, ValuesIn(cases));
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ const std::vector<std::pair<KeyNibbles, Buffer>> NIBBLES_TO_KEY_LE = {
{{0xa, 0xa, 0xf, 0xf, 0x0, 0x1, 0xc}, {0xa, 0xaf, 0xf0, 0x1c}}
};

INSTANTIATE_TEST_CASE_P(KeyToNibbles, KeyToNibbles, ::testing::ValuesIn(KEY_TO_NIBBLES));
INSTANTIATE_TEST_CASE_P(NibblesToKeyLE, NibblesToKey, ::testing::ValuesIn(NIBBLES_TO_KEY_LE));
INSTANTIATE_TEST_SUITE_P(KeyToNibbles, KeyToNibbles, ::testing::ValuesIn(KEY_TO_NIBBLES));
INSTANTIATE_TEST_SUITE_P(NibblesToKeyLE, NibblesToKey, ::testing::ValuesIn(NIBBLES_TO_KEY_LE));
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ static const std::vector<std::shared_ptr<SuperGeniusNode>> CASES = {
make<BranchNode>("010203"_hex2buf, "abcdef"_hex2buf),
branch_with_2_children};

INSTANTIATE_TEST_CASE_P(SuperGeniusCodec, NodeDecodingTest, ValuesIn(CASES));
INSTANTIATE_TEST_SUITE_P(SuperGeniusCodec, NodeDecodingTest, ValuesIn(CASES));
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ TEST_P(NodeEncodingTest, GetHeader) {
// {BRANCH_VAL | 63u, 255, 255, 0}}, // 22
// };

//INSTANTIATE_TEST_CASE_P(SuperGeniusCodec, NodeEncodingTest, ValuesIn(CASES));
//INSTANTIATE_TEST_SUITE_P(SuperGeniusCodec, NodeEncodingTest, ValuesIn(CASES));

0 comments on commit 73891a5

Please sign in to comment.