From 1779ea82b6e7792c65103d1dead8d301950a6c10 Mon Sep 17 00:00:00 2001 From: Christian Linke Date: Mon, 3 Nov 2014 10:31:16 +0100 Subject: * Fixed missing reserved flag for MapHandler and corresponding tests Signed-off-by: Christian Linke --- AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp | 3 ++- AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp | 3 +++ AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp index d3df07f..a7b765d 100644 --- a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp +++ b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp @@ -399,7 +399,7 @@ template bool CAmDatabaseHandlerMap::CAmMapp nextID = sourceID.mCurrentValue++; } - if( nextID == lastID ) + if( sourceID.mCurrentValue == lastID ) { notFreeIDs = true; break; @@ -864,6 +864,7 @@ am_Error_e CAmDatabaseHandlerMap::enterConnectionDB(const am_Connection_s& conne connectionID = nextID; mMappedData.mConnectionMap[nextID] = connection; mMappedData.mConnectionMap[nextID].connectionID = nextID; + mMappedData.mConnectionMap[nextID].reserved = true; } else { diff --git a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp index 25c61cc..d4351b9 100644 --- a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp +++ b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp @@ -2302,6 +2302,7 @@ TEST_F(CAmMapHandlerTest, connectionIDBoundary) if( i < TEST_MAX_CONNECTION_ID ) { ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID)); + ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID)); ASSERT_EQ(i, connectionID); } } @@ -2309,6 +2310,7 @@ TEST_F(CAmMapHandlerTest, connectionIDBoundary) ASSERT_EQ(E_OK, pDatabaseHandler.getListConnections(connectionList)); ASSERT_EQ(TEST_MAX_CONNECTION_ID-1, connectionList.size()); ASSERT_EQ(E_UNKNOWN, pDatabaseHandler.enterConnectionDB(connection,connectionID)); + logInfo("here"); ASSERT_EQ(0, connectionID); ASSERT_EQ(E_OK, pDatabaseHandler.removeConnection(10)); @@ -2353,6 +2355,7 @@ TEST_F(CAmMapHandlerTest, mainConnectionIDBoundary) if( i < TEST_MAX_CONNECTION_ID ) { ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID)); + ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID)); ASSERT_EQ(i, connectionID); connectionIDList.push_back(i); } diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h index 257d1e6..5cff152 100644 --- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h +++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h @@ -29,12 +29,8 @@ #include "CAmControlSender.h" #include "CAmRouter.h" #include "config.h" +#include "CAmDatabaseHandlerMap.h" -#ifdef WITH_DATABASE_STORAGE - #include "CAmDatabaseHandlerSQLite.h" -#else - #include "CAmDatabaseHandlerMap.h" -#endif namespace am { -- cgit v1.2.1