Updated unit tests to use new SetProperty interface

pull/546/head
Léo Terziman 2015-04-28 17:27:20 +02:00
parent d809ca98c1
commit 07f3f4b487
1 changed files with 4 additions and 7 deletions

View File

@ -131,21 +131,19 @@ TEST_F(ImporterTest, testMemoryRead)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
TEST_F(ImporterTest, testIntProperty) TEST_F(ImporterTest, testIntProperty)
{ {
bool b; bool b = pImp->SetPropertyInteger("quakquak",1503);
pImp->SetPropertyInteger("quakquak",1503,&b);
EXPECT_FALSE(b); EXPECT_FALSE(b);
EXPECT_EQ(1503, pImp->GetPropertyInteger("quakquak",0)); EXPECT_EQ(1503, pImp->GetPropertyInteger("quakquak",0));
EXPECT_EQ(314159, pImp->GetPropertyInteger("not_there",314159)); EXPECT_EQ(314159, pImp->GetPropertyInteger("not_there",314159));
pImp->SetPropertyInteger("quakquak",1504,&b); b = pImp->SetPropertyInteger("quakquak",1504);
EXPECT_TRUE(b); EXPECT_TRUE(b);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
TEST_F(ImporterTest, testFloatProperty) TEST_F(ImporterTest, testFloatProperty)
{ {
bool b; bool b = pImp->SetPropertyFloat("quakquak",1503.f);
pImp->SetPropertyFloat("quakquak",1503.f,&b);
EXPECT_TRUE(!b); EXPECT_TRUE(!b);
EXPECT_EQ(1503.f, pImp->GetPropertyFloat("quakquak",0.f)); EXPECT_EQ(1503.f, pImp->GetPropertyFloat("quakquak",0.f));
EXPECT_EQ(314159.f, pImp->GetPropertyFloat("not_there",314159.f)); EXPECT_EQ(314159.f, pImp->GetPropertyFloat("not_there",314159.f));
@ -154,8 +152,7 @@ TEST_F(ImporterTest, testFloatProperty)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
TEST_F(ImporterTest, testStringProperty) TEST_F(ImporterTest, testStringProperty)
{ {
bool b; bool b = pImp->SetPropertyString("quakquak","test");
pImp->SetPropertyString("quakquak","test",&b);
EXPECT_TRUE(!b); EXPECT_TRUE(!b);
EXPECT_EQ("test", pImp->GetPropertyString("quakquak","weghwekg")); EXPECT_EQ("test", pImp->GetPropertyString("quakquak","weghwekg"));
EXPECT_EQ("ILoveYou", pImp->GetPropertyString("not_there","ILoveYou")); EXPECT_EQ("ILoveYou", pImp->GetPropertyString("not_there","ILoveYou"));