1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix tests + scripting compilation on gcc

This commit is contained in:
Dydzio
2023-01-04 21:33:56 +01:00
committed by Ivan Savenko
parent 1700a598f6
commit a2ce9220ed
15 changed files with 45 additions and 41 deletions

View File

@@ -19,7 +19,7 @@ using namespace ::testing;
class CFactionTest : public Test
{
public:
MOCK_METHOD3(registarCb, void(int32_t, const std::string &, const std::string &));
MOCK_METHOD4(registarCb, void(int32_t, int32_t, const std::string &, const std::string &));
protected:
std::shared_ptr<CFaction> subject;
@@ -41,13 +41,13 @@ TEST_F(CFactionTest, HasTown)
TEST_F(CFactionTest, RegistersNoIconsIfNoTown)
{
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3);
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3, _4);
subject->registerIcons(cb);
}
TEST_F(CFactionTest, RegistersIcons)
{
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3);
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3, _4);
subject->town = new CTown();
@@ -69,15 +69,15 @@ TEST_F(CFactionTest, RegistersIcons)
info.iconSmall[1][1] = "Test40";
EXPECT_CALL(*this, registarCb(Eq(10), "ITPT", "Test1"));
EXPECT_CALL(*this, registarCb(Eq(11), "ITPT", "Test2"));
EXPECT_CALL(*this, registarCb(Eq(12), "ITPT", "Test3"));
EXPECT_CALL(*this, registarCb(Eq(13), "ITPT", "Test4"));
EXPECT_CALL(*this, registarCb(Eq(10), Eq(0), "ITPT", "Test1"));
EXPECT_CALL(*this, registarCb(Eq(11), Eq(0), "ITPT", "Test2"));
EXPECT_CALL(*this, registarCb(Eq(12), Eq(0), "ITPT", "Test3"));
EXPECT_CALL(*this, registarCb(Eq(13), Eq(0), "ITPT", "Test4"));
EXPECT_CALL(*this, registarCb(Eq(12), "ITPA", "Test10"));
EXPECT_CALL(*this, registarCb(Eq(13), "ITPA", "Test20"));
EXPECT_CALL(*this, registarCb(Eq(14), "ITPA", "Test30"));
EXPECT_CALL(*this, registarCb(Eq(15), "ITPA", "Test40"));
EXPECT_CALL(*this, registarCb(Eq(12), Eq(0), "ITPA", "Test10"));
EXPECT_CALL(*this, registarCb(Eq(13), Eq(0), "ITPA", "Test20"));
EXPECT_CALL(*this, registarCb(Eq(14), Eq(0), "ITPA", "Test30"));
EXPECT_CALL(*this, registarCb(Eq(15), Eq(0), "ITPA", "Test40"));
subject->registerIcons(cb);
}