Fix: Test structure shadowing Google Test suite one (#1417)

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Berbe 2020-09-07 20:52:05 +02:00 committed by GitHub
parent 90ce7efc09
commit 8445e090a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 21 deletions

View File

@ -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, 24>{
Test{ "-BT791B-", "BitTorrent 7.9.1 (Beta)" },
auto constexpr Tests = std::array<Test_local, 24>{
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" },

View File

@ -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, 2>{
Test{ "test", "{15ad0621b259a84d24dcd4e75b09004e98a3627bAMbyRHJy" },
auto constexpr Tests = std::array<Test_local, 2>{
Test_local{ "test", "{15ad0621b259a84d24dcd4e75b09004e98a3627bAMbyRHJy" },
{ "QNY)(*#$B)!_X$B !_B#($^!)*&$%CV!#)&$C!@$(P*)", "{10e2d7acbb104d970514a147cd16d51dfa40fb3c0OSwJtOL" }
};

View File

@ -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<Test, 5>
auto const tests = std::array<Test_local, 5>
{
Test{ "", "" },
Test_local{ "", "" },
{ "a", TR_IF_WIN32("a", "a") },
{ "/", TR_IF_WIN32("\\", "/") },
{ "/a/b/c", TR_IF_WIN32("\\a\\b\\c", "/a/b/c") },

View File

@ -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, 9>{
Test{ 0, TR_PARSE_OK, BEFORE_PATH "5:a.txt" AFTER_PATH },
auto constexpr Tests = std::array<Test_local, 9>{
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<Test, 29>{
auto constexpr Tests = std::array<Test_local, 29>{
// skipped
Test{ "", 0, nullptr, false },
Test_local{ "", 0, nullptr, false },
{ ".", 1, nullptr, false },
{ "..", 2, nullptr, true },
{ ".....", 5, nullptr, false },

View File

@ -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, 9>{
Test{ "llleee", true },
auto const tests = std::array<Test_local, 9>{
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, 5>{
Test{ "i6e", "6" },
auto const tests = std::array<Test_local, 5>{
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})" },