BOOST_FIXTURE_TEST_CASE(ConstructorEmpty2Config, TestHomeAndPibFixture<PibPathEmptyFile>) { createClientConf({"tpm=tpm-file:%PATH%"}); BOOST_REQUIRE_NO_THROW(KeyChain()); KeyChain keyChain; BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-sqlite3:"); BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-file:" + m_pibDir); BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-file:" + m_pibDir); }
BOOST_FIXTURE_TEST_CASE(ConstructorEmptyConfig, TestHomeAndPibFixture<PibPathSqlite3Empty>) { createClientConf({"pib=pib-sqlite3:%PATH%"}); #if defined(NDN_CXX_HAVE_OSX_SECURITY) std::string oldHOME; if (std::getenv("OLD_HOME")) oldHOME = std::getenv("OLD_HOME"); std::string HOME; if (std::getenv("HOME")) HOME = std::getenv("HOME"); if (!oldHOME.empty()) setenv("HOME", oldHOME.c_str(), true); else unsetenv("HOME"); #endif BOOST_REQUIRE_NO_THROW(KeyChain()); KeyChain keyChain; BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-sqlite3:" + m_pibDir); #if defined(NDN_CXX_HAVE_OSX_SECURITY) BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-osxkeychain:"); BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-osxkeychain:"); #else BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-file:"); BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-file:"); #endif #if defined(NDN_CXX_HAVE_OSX_SECURITY) if (!HOME.empty()) setenv("HOME", HOME.c_str(), true); else unsetenv("HOME"); #endif }