Merge pull request #13672 from tygyh/UnitTests/Remove-redundant-template-type-specifiers
UnitTests: Remove redundant template type specifers
This commit is contained in:
commit
2e22a3cf42
|
@ -88,7 +88,7 @@ TEST(BitSet, BitOps)
|
||||||
|
|
||||||
TEST(BitSet, InitializerListsAndIteration)
|
TEST(BitSet, InitializerListsAndIteration)
|
||||||
{
|
{
|
||||||
std::vector<int> bits{1, 10, 15, 17, 20, 30};
|
std::vector bits{1, 10, 15, 17, 20, 30};
|
||||||
BitSet32 bs{1, 10, 15, 17, 20, 30};
|
BitSet32 bs{1, 10, 15, 17, 20, 30};
|
||||||
auto vit = bits.begin();
|
auto vit = bits.begin();
|
||||||
for (auto i : bs)
|
for (auto i : bs)
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
TEST(BlockingLoop, MultiThreaded)
|
TEST(BlockingLoop, MultiThreaded)
|
||||||
{
|
{
|
||||||
Common::BlockingLoop loop;
|
Common::BlockingLoop loop;
|
||||||
std::atomic<int> signaled_a(0);
|
std::atomic signaled_a(0);
|
||||||
std::atomic<int> received_a(0);
|
std::atomic received_a(0);
|
||||||
std::atomic<int> signaled_b(0);
|
std::atomic signaled_b(0);
|
||||||
std::atomic<int> received_b(0);
|
std::atomic received_b(0);
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
// Invalidate the current state.
|
// Invalidate the current state.
|
||||||
|
|
|
@ -49,7 +49,7 @@ TEST(FloatUtils, FlushToZero)
|
||||||
|
|
||||||
// Test all subnormals as well as an equally large set of random normal floats.
|
// Test all subnormals as well as an equally large set of random normal floats.
|
||||||
std::default_random_engine engine(0);
|
std::default_random_engine engine(0);
|
||||||
std::uniform_int_distribution<u32> dist(0x00800000u, 0x7fffffffu);
|
std::uniform_int_distribution dist(0x00800000u, 0x7fffffffu);
|
||||||
for (u32 i = 0; i <= 0x007fffffu; ++i)
|
for (u32 i = 0; i <= 0x007fffffu; ++i)
|
||||||
{
|
{
|
||||||
u32 i_tmp = i;
|
u32 i_tmp = i;
|
||||||
|
|
|
@ -70,51 +70,51 @@ TEST(MathUtil, SaturatingCast)
|
||||||
|
|
||||||
TEST(MathUtil, RectangleEquality)
|
TEST(MathUtil, RectangleEquality)
|
||||||
{
|
{
|
||||||
MathUtil::Rectangle<int> rect_a(1, 1, 4, 7);
|
MathUtil::Rectangle rect_a(1, 1, 4, 7);
|
||||||
MathUtil::Rectangle<int> rect_b(1, 1, 4, 7);
|
MathUtil::Rectangle rect_b(1, 1, 4, 7);
|
||||||
EXPECT_EQ(rect_a, rect_b);
|
EXPECT_EQ(rect_a, rect_b);
|
||||||
|
|
||||||
// Left not equal
|
// Left not equal
|
||||||
MathUtil::Rectangle<int> rect_c(0, 1, 4, 7);
|
MathUtil::Rectangle rect_c(0, 1, 4, 7);
|
||||||
EXPECT_NE(rect_a, rect_c);
|
EXPECT_NE(rect_a, rect_c);
|
||||||
|
|
||||||
// Top not equal
|
// Top not equal
|
||||||
MathUtil::Rectangle<int> rect_d(1, 3, 4, 7);
|
MathUtil::Rectangle rect_d(1, 3, 4, 7);
|
||||||
EXPECT_NE(rect_a, rect_d);
|
EXPECT_NE(rect_a, rect_d);
|
||||||
|
|
||||||
// Right not equal
|
// Right not equal
|
||||||
MathUtil::Rectangle<int> rect_e(1, 1, 2, 7);
|
MathUtil::Rectangle rect_e(1, 1, 2, 7);
|
||||||
EXPECT_NE(rect_a, rect_e);
|
EXPECT_NE(rect_a, rect_e);
|
||||||
|
|
||||||
// Bottom not equal
|
// Bottom not equal
|
||||||
MathUtil::Rectangle<int> rect_f(1, 1, 4, 9);
|
MathUtil::Rectangle rect_f(1, 1, 4, 9);
|
||||||
EXPECT_NE(rect_a, rect_f);
|
EXPECT_NE(rect_a, rect_f);
|
||||||
|
|
||||||
// No coordinates equal
|
// No coordinates equal
|
||||||
MathUtil::Rectangle<int> rect_g(0, 3, 2, 9);
|
MathUtil::Rectangle rect_g(0, 3, 2, 9);
|
||||||
EXPECT_NE(rect_a, rect_g);
|
EXPECT_NE(rect_a, rect_g);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MathUtil, RectangleGetWidthSigned)
|
TEST(MathUtil, RectangleGetWidthSigned)
|
||||||
{
|
{
|
||||||
// left < right
|
// left < right
|
||||||
MathUtil::Rectangle<int> rect_a(2, 1, 3, 2);
|
MathUtil::Rectangle rect_a(2, 1, 3, 2);
|
||||||
EXPECT_EQ(rect_a.GetWidth(), 1);
|
EXPECT_EQ(rect_a.GetWidth(), 1);
|
||||||
|
|
||||||
// left > right
|
// left > right
|
||||||
MathUtil::Rectangle<int> rect_b(3, 1, 1, 2);
|
MathUtil::Rectangle rect_b(3, 1, 1, 2);
|
||||||
EXPECT_EQ(rect_b.GetWidth(), 2);
|
EXPECT_EQ(rect_b.GetWidth(), 2);
|
||||||
|
|
||||||
// left == right
|
// left == right
|
||||||
MathUtil::Rectangle<int> rect_c(3, 1, 3, 2);
|
MathUtil::Rectangle rect_c(3, 1, 3, 2);
|
||||||
EXPECT_EQ(rect_c.GetWidth(), 0);
|
EXPECT_EQ(rect_c.GetWidth(), 0);
|
||||||
|
|
||||||
// Most significant bit differs, left < right
|
// Most significant bit differs, left < right
|
||||||
MathUtil::Rectangle<int> rect_d(-9, 1, 1, 2);
|
MathUtil::Rectangle rect_d(-9, 1, 1, 2);
|
||||||
EXPECT_EQ(rect_d.GetWidth(), 10);
|
EXPECT_EQ(rect_d.GetWidth(), 10);
|
||||||
|
|
||||||
// Most significant bit differs, left > right
|
// Most significant bit differs, left > right
|
||||||
MathUtil::Rectangle<int> rect_e(1, 1, -6, 2);
|
MathUtil::Rectangle rect_e(1, 1, -6, 2);
|
||||||
EXPECT_EQ(rect_e.GetWidth(), 7);
|
EXPECT_EQ(rect_e.GetWidth(), 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,23 +144,23 @@ TEST(MathUtil, RectangleGetWidthUnsigned)
|
||||||
TEST(MathUtil, RectangleGetHeightSigned)
|
TEST(MathUtil, RectangleGetHeightSigned)
|
||||||
{
|
{
|
||||||
// top < bottom
|
// top < bottom
|
||||||
MathUtil::Rectangle<int> rect_a(1, 1, 2, 3);
|
MathUtil::Rectangle rect_a(1, 1, 2, 3);
|
||||||
EXPECT_EQ(rect_a.GetHeight(), 2);
|
EXPECT_EQ(rect_a.GetHeight(), 2);
|
||||||
|
|
||||||
// top > bottom
|
// top > bottom
|
||||||
MathUtil::Rectangle<int> rect_b(1, 4, 2, 0);
|
MathUtil::Rectangle rect_b(1, 4, 2, 0);
|
||||||
EXPECT_EQ(rect_b.GetHeight(), 4);
|
EXPECT_EQ(rect_b.GetHeight(), 4);
|
||||||
|
|
||||||
// top == bottom
|
// top == bottom
|
||||||
MathUtil::Rectangle<int> rect_c(1, 3, 2, 3);
|
MathUtil::Rectangle rect_c(1, 3, 2, 3);
|
||||||
EXPECT_EQ(rect_c.GetHeight(), 0);
|
EXPECT_EQ(rect_c.GetHeight(), 0);
|
||||||
|
|
||||||
// Most significant bit differs, top < bottom
|
// Most significant bit differs, top < bottom
|
||||||
MathUtil::Rectangle<int> rect_d(1, -2, 2, 1);
|
MathUtil::Rectangle rect_d(1, -2, 2, 1);
|
||||||
EXPECT_EQ(rect_d.GetHeight(), 3);
|
EXPECT_EQ(rect_d.GetHeight(), 3);
|
||||||
|
|
||||||
// Most significant bit differs, top > bottom
|
// Most significant bit differs, top > bottom
|
||||||
MathUtil::Rectangle<int> rect_e(1, 0, 2, -1);
|
MathUtil::Rectangle rect_e(1, 0, 2, -1);
|
||||||
EXPECT_EQ(rect_e.GetHeight(), 1);
|
EXPECT_EQ(rect_e.GetHeight(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ protected:
|
||||||
|
|
||||||
void ExpectBytes(const std::vector<u8> expected_bytes)
|
void ExpectBytes(const std::vector<u8> expected_bytes)
|
||||||
{
|
{
|
||||||
const std::vector<u8> code_bytes(code_buffer, emitter->GetWritableCodePtr());
|
const std::vector code_bytes(code_buffer, emitter->GetWritableCodePtr());
|
||||||
|
|
||||||
EXPECT_EQ(expected_bytes, code_bytes);
|
EXPECT_EQ(expected_bytes, code_bytes);
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,13 @@ TEST(TMDReader, Validity)
|
||||||
tmd = IOS::ES::TMDReader{{1, 2, 3}};
|
tmd = IOS::ES::TMDReader{{1, 2, 3}};
|
||||||
EXPECT_FALSE(tmd.IsValid()) << "IsValid should be false when reading an invalid TMD";
|
EXPECT_FALSE(tmd.IsValid()) << "IsValid should be false when reading an invalid TMD";
|
||||||
|
|
||||||
tmd = IOS::ES::TMDReader{std::vector<u8>(soup01_tmd.cbegin(), soup01_tmd.cend() - 1)};
|
tmd = IOS::ES::TMDReader{std::vector(soup01_tmd.cbegin(), soup01_tmd.cend() - 1)};
|
||||||
EXPECT_FALSE(tmd.IsValid()) << "IsValid should be false when reading an invalid TMD";
|
EXPECT_FALSE(tmd.IsValid()) << "IsValid should be false when reading an invalid TMD";
|
||||||
|
|
||||||
tmd = IOS::ES::TMDReader{std::vector<u8>(soup01_tmd.cbegin(), soup01_tmd.cend())};
|
tmd = IOS::ES::TMDReader{std::vector(soup01_tmd.cbegin(), soup01_tmd.cend())};
|
||||||
EXPECT_TRUE(tmd.IsValid()) << "IsValid should be true when reading a valid TMD";
|
EXPECT_TRUE(tmd.IsValid()) << "IsValid should be true when reading a valid TMD";
|
||||||
|
|
||||||
tmd = IOS::ES::TMDReader{std::vector<u8>(ios59_tmd.cbegin(), ios59_tmd.cend())};
|
tmd = IOS::ES::TMDReader{std::vector(ios59_tmd.cbegin(), ios59_tmd.cend())};
|
||||||
EXPECT_TRUE(tmd.IsValid()) << "IsValid should be true when reading a valid TMD";
|
EXPECT_TRUE(tmd.IsValid()) << "IsValid should be true when reading a valid TMD";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class GameTMDReaderTest : public TMDReaderTest
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override
|
void SetUp() override
|
||||||
{
|
{
|
||||||
m_raw_tmd = std::vector<u8>(soup01_tmd.cbegin(), soup01_tmd.cend());
|
m_raw_tmd = std::vector(soup01_tmd.cbegin(), soup01_tmd.cend());
|
||||||
TMDReaderTest::SetUp();
|
TMDReaderTest::SetUp();
|
||||||
}
|
}
|
||||||
u64 GetTitleId() const override { return 0x00010000534f5550; }
|
u64 GetTitleId() const override { return 0x00010000534f5550; }
|
||||||
|
@ -99,7 +99,7 @@ protected:
|
||||||
std::string GetGameID() const override { return "SOUP01"; }
|
std::string GetGameID() const override { return "SOUP01"; }
|
||||||
std::vector<u8> GetRawView() const override
|
std::vector<u8> GetRawView() const override
|
||||||
{
|
{
|
||||||
return std::vector<u8>(soup01_tmd_view.cbegin(), soup01_tmd_view.cend());
|
return std::vector(soup01_tmd_view.cbegin(), soup01_tmd_view.cend());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ class IOSTMDReaderTest : public TMDReaderTest
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override
|
void SetUp() override
|
||||||
{
|
{
|
||||||
m_raw_tmd = std::vector<u8>(ios59_tmd.cbegin(), ios59_tmd.cend());
|
m_raw_tmd = std::vector(ios59_tmd.cbegin(), ios59_tmd.cend());
|
||||||
TMDReaderTest::SetUp();
|
TMDReaderTest::SetUp();
|
||||||
}
|
}
|
||||||
u64 GetTitleId() const override { return 0x000000010000003b; }
|
u64 GetTitleId() const override { return 0x000000010000003b; }
|
||||||
|
@ -158,7 +158,7 @@ protected:
|
||||||
std::string GetGameID() const override { return "000000010000003b"; }
|
std::string GetGameID() const override { return "000000010000003b"; }
|
||||||
std::vector<u8> GetRawView() const override
|
std::vector<u8> GetRawView() const override
|
||||||
{
|
{
|
||||||
return std::vector<u8>(ios59_tmd_view.cbegin(), ios59_tmd_view.cend());
|
return std::vector(ios59_tmd_view.cbegin(), ios59_tmd_view.cend());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue