Commit 4d7d6783 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2369] Read data from the test file to check the InputSource

parent ed1a2ad7
...@@ -118,16 +118,13 @@ TEST_F(InputSourceTest, stream) { ...@@ -118,16 +118,13 @@ TEST_F(InputSourceTest, stream) {
} }
TEST_F(InputSourceTest, file) { TEST_F(InputSourceTest, file) {
const char* str = std::ifstream fs(TEST_DATA_SRCDIR "/masterload.txt");
";; a simple (incomplete) zone file\n" std::string str((std::istreambuf_iterator<char>(fs)),
"\n" std::istreambuf_iterator<char>());
"example.com. 3600 IN TXT \"test data\"\n" fs.close();
"www.example.com. 60 IN A 192.0.2.1\n"
"www.example.com. 60 IN A 192.0.2.2\n";
size_t str_length = strlen(str);
InputSource source(TEST_DATA_SRCDIR "/masterload.txt"); InputSource source(TEST_DATA_SRCDIR "/masterload.txt");
checkGetAndUngetChar(source, str, str_length); checkGetAndUngetChar(source, str.c_str(), str.size());
} }
// ungetAll() should skip back to the place where the InputSource // ungetAll() should skip back to the place where the InputSource
......
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