From 8f039182978a53b5e3f129f098ea0c3a725dd588 Mon Sep 17 00:00:00 2001 From: Christian Linke Date: Thu, 13 Jun 2013 10:40:17 +0200 Subject: [PATCH] * adds test for bug63 to the database tests Signed-off-by: Christian Linke --- .../CAmDatabaseHandlerTest.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp index 979db81..6b61816 100644 --- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp +++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp @@ -2229,6 +2229,30 @@ TEST_F(CAmDatabaseHandlerTest,changeMainNotificationsSink) ASSERT_EQ(returnList1[3].type,notify2.type); } +TEST_F(CAmDatabaseHandlerTest, peekDomain_2) +{ + std::vector listDomains; + am_Domain_s domain; + am_domainID_t domainID; + am_domainID_t domain2ID; + pCF.createDomain(domain); + ASSERT_EQ(E_OK,pDatabaseHandler.peekDomain(std::string("newdomain"),domainID)); + ASSERT_EQ(E_OK, pDatabaseHandler.getListDomains(listDomains)); + ASSERT_TRUE(listDomains.empty()); + ASSERT_EQ(domainID, 1); + + domain.name = "anotherdomain"; + ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domain2ID)); + ASSERT_EQ(E_OK, pDatabaseHandler.getListDomains(listDomains)); + ASSERT_EQ(domain2ID, 2); + + domain.name = "newdomain"; + ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domain2ID)); + ASSERT_EQ(E_OK, pDatabaseHandler.getListDomains(listDomains)); + ASSERT_EQ(domainID, domain2ID); // FAILS, ID is 2 instead of 1 + ASSERT_TRUE(listDomains[0].domainID==domainID); +} + //Commented out - gives always a warning.. //TEST_F(databaseTest,registerDomainFailonID0) //{ -- 2.7.4