From 8445e090a72cc5e1cd63002d46b3e24ddceed583 Mon Sep 17 00:00:00 2001 From: Berbe <4251220+Berbe@users.noreply.github.com> Date: Mon, 7 Sep 2020 20:52:05 +0200 Subject: [PATCH] Fix: Test structure shadowing Google Test suite one (#1417) Co-authored-by: Charles Kerr --- tests/libtransmission/clients-test.cc | 6 +++--- tests/libtransmission/crypto-test.cc | 6 +++--- tests/libtransmission/file-test.cc | 6 +++--- tests/libtransmission/metainfo-test.cc | 12 ++++++------ tests/libtransmission/variant-test.cc | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/libtransmission/clients-test.cc b/tests/libtransmission/clients-test.cc index 618530647..6a8d00799 100644 --- a/tests/libtransmission/clients-test.cc +++ b/tests/libtransmission/clients-test.cc @@ -15,14 +15,14 @@ TEST(Client, clientForId) { - struct Test + struct Test_local { char const* peer_id; char const* expected_client; }; - auto constexpr Tests = std::array{ - Test{ "-BT791B-", "BitTorrent 7.9.1 (Beta)" }, + auto constexpr Tests = std::array{ + Test_local{ "-BT791B-", "BitTorrent 7.9.1 (Beta)" }, { "-BT791\0-", "BitTorrent 7.9.1" }, { "-FC1013-", "FileCroc 1.0.1.3" }, { "-FC1013-", "FileCroc 1.0.1.3" }, diff --git a/tests/libtransmission/crypto-test.cc b/tests/libtransmission/crypto-test.cc index fdf6a4621..004661334 100644 --- a/tests/libtransmission/crypto-test.cc +++ b/tests/libtransmission/crypto-test.cc @@ -122,14 +122,14 @@ TEST(Crypto, sha1) TEST(Crypto, ssha1) { - struct Test + struct Test_local { char const* const plain_text; char const* const ssha1; }; - auto constexpr Tests = std::array{ - Test{ "test", "{15ad0621b259a84d24dcd4e75b09004e98a3627bAMbyRHJy" }, + auto constexpr Tests = std::array{ + Test_local{ "test", "{15ad0621b259a84d24dcd4e75b09004e98a3627bAMbyRHJy" }, { "QNY)(*#$B)!_X$B !_B#($^!)*&$%CV!#)&$C!@$(P*)", "{10e2d7acbb104d970514a147cd16d51dfa40fb3c0OSwJtOL" } }; diff --git a/tests/libtransmission/file-test.cc b/tests/libtransmission/file-test.cc index 8875beb61..d009cc6dc 100644 --- a/tests/libtransmission/file-test.cc +++ b/tests/libtransmission/file-test.cc @@ -976,15 +976,15 @@ TEST_F(FileTest, pathNativeSeparators) { EXPECT_EQ(nullptr, tr_sys_path_native_separators(nullptr)); - struct Test + struct Test_local { std::string input; std::string expected_output; }; - auto const tests = std::array + auto const tests = std::array { - Test{ "", "" }, + Test_local{ "", "" }, { "a", TR_IF_WIN32("a", "a") }, { "/", TR_IF_WIN32("\\", "/") }, { "/a/b/c", TR_IF_WIN32("\\a\\b\\c", "/a/b/c") }, diff --git a/tests/libtransmission/metainfo-test.cc b/tests/libtransmission/metainfo-test.cc index ff13f1ae5..479529e6c 100644 --- a/tests/libtransmission/metainfo-test.cc +++ b/tests/libtransmission/metainfo-test.cc @@ -52,15 +52,15 @@ TEST(Metainfo, magnetLink) // FIXME: split these into parameterized tests? TEST(Metainfo, bucket) { - struct Test + struct Test_local { int expected_benc_err; int expected_parse_result; void const* benc; }; - auto constexpr Tests = std::array{ - Test{ 0, TR_PARSE_OK, BEFORE_PATH "5:a.txt" AFTER_PATH }, + auto constexpr Tests = std::array{ + Test_local{ 0, TR_PARSE_OK, BEFORE_PATH "5:a.txt" AFTER_PATH }, /* allow empty components, but not =all= empty components, see bug #5517 */ { 0, TR_PARSE_OK, BEFORE_PATH "0:5:a.txt" AFTER_PATH }, @@ -101,7 +101,7 @@ TEST(Metainfo, bucket) TEST(Metainfo, sanitize) { - struct Test + struct Test_local { char const* str; size_t len; @@ -109,9 +109,9 @@ TEST(Metainfo, sanitize) bool expected_is_adjusted; }; - auto constexpr Tests = std::array{ + auto constexpr Tests = std::array{ // skipped - Test{ "", 0, nullptr, false }, + Test_local{ "", 0, nullptr, false }, { ".", 1, nullptr, false }, { "..", 2, nullptr, true }, { ".....", 5, nullptr, false }, diff --git a/tests/libtransmission/variant-test.cc b/tests/libtransmission/variant-test.cc index ec031684b..7b01ed987 100644 --- a/tests/libtransmission/variant-test.cc +++ b/tests/libtransmission/variant-test.cc @@ -249,14 +249,14 @@ TEST_F(VariantTest, parse) } TEST_F(VariantTest, bencParseAndReencode) { - struct Test + struct Test_local { std::string benc; bool is_good; }; - auto const tests = std::array{ - Test{ "llleee", true }, + auto const tests = std::array{ + Test_local{ "llleee", true }, { "d3:cow3:moo4:spam4:eggse", true }, { "d4:spaml1:a1:bee", true }, { "d5:greenli1ei2ei3ee4:spamd1:ai123e3:keyi214eee", true }, @@ -343,14 +343,14 @@ TEST_F(VariantTest, bencMalformedIncompleteString) TEST_F(VariantTest, bencToJson) { - struct Test + struct Test_local { std::string benc; std::string expected; }; - auto const tests = std::array{ - Test{ "i6e", "6" }, + auto const tests = std::array{ + Test_local{ "i6e", "6" }, { "d5:helloi1e5:worldi2ee", R"({"hello":1,"world":2})" }, { "d5:helloi1e5:worldi2e3:fooli1ei2ei3eee", R"({"foo":[1,2,3],"hello":1,"world":2})" }, { "d5:helloi1e5:worldi2e3:fooli1ei2ei3ed1:ai0eeee", R"({"foo":[1,2,3,{"a":0}],"hello":1,"world":2})" },