void test_ServerAttribute() { // Add an attribute CPPUNIT_ASSERT( msdo->addServerAttribute("test-session","test1", "test1" ) == true ); // Assert we have a single attribute CPPUNIT_ASSERT( msdo->getServerSessionCount() == 1 ); // Assert that the value we just inserted is good CPPUNIT_ASSERT( msdo->getServerAttribute("test-session", "test1" ) == "test1" ); // Add another of the same name, which is effectively an update CPPUNIT_ASSERT( msdo->addServerAttribute("test-session", "test1", "updated") == true ); CPPUNIT_ASSERT( msdo->getServerAttribute("test-session","test1") == "updated"); // Remove the object msdo->removeServerAttribute("test-session", "test1" ); // Make sure it's gone CPPUNIT_ASSERT( msdo->getServerAttribute("test-session", "test1" ) == "" ); // Can't have an empty sessionid or name/key CPPUNIT_ASSERT( msdo->addServerAttribute("","key","value") == false ); CPPUNIT_ASSERT( msdo->addServerAttribute("test-session", "", "value") == false ); }