Commit a8312db1 authored by Jerry's avatar Jerry
Browse files

fix a unittest issue


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac439@3945 e5f2f494-b856-4b98-b285-d166d9295462
parent 8a3fc03b
......@@ -47,11 +47,14 @@ using namespace asio_link;
namespace {
const char* const CONFIG_TESTDB =
"{\"database_file\": \"" TEST_DATA_DIR "/example.sqlite3\"}";
"{\"database_file\": \"" TEST_DATA_DIR "/example.sqlite3\", \"use_memory_datasrc\": false}";
const char* const MEMORY_CONFIG_TESTDB =
"{\"database_file\": \"" TEST_DATA_DIR "/example.sqlite3\", \"use_memory_datasrc\": true}";
// The following file must be non existent and must be non"creatable" (see
// the sqlite3 test).
const char* const BADCONFIG_TESTDB =
"{ \"database_file\": \"" TEST_DATA_DIR "/nodir/notexist\"}";
"{ \"database_file\": \"" TEST_DATA_DIR "/nodir/notexist\", \"use_memory_datasrc\": false}";
const char* const DEFAULT_REMOTE_ADDRESS = "192.0.2.1";
class AuthSrvTest : public ::testing::Test {
......@@ -758,6 +761,18 @@ TEST_F(AuthSrvTest, updateConfigFail) {
QR_FLAG | AA_FLAG, 1, 1, 1, 0);
}
TEST_F(AuthSrvTest, useMemoryDataSrc) {
// First, load a memory data source.
updateConfig(&server, MEMORY_CONFIG_TESTDB, true);
// The memory data source is empty, should return SERVFAIL rcode.
createDataFromFile("examplequery_fromWire.wire");
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::SERVFAIL(), opcode.getCode(),
QR_FLAG | AA_FLAG, 1, 0, 0, 0);
}
TEST_F(AuthSrvTest, cacheSlots) {
// simple check for the get/set operations
server.setCacheSlots(10); // 10 = arbitrary choice
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment