Commit ca10116a authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[4096] Added unit test for an blank client class name

parent 5305d4ea
......@@ -370,7 +370,7 @@ TEST_F(ClientClassDefParserTest, noClassName) {
std::string cfg_text =
"{ \n"
" \"test\": \"vendor-class-identifier == 'MSFT'\", \n"
" \"test\": \"option[123] == 'abc'\", \n"
" \"option-data\": [ \n"
" { \n"
" \"name\": \"domain-name-servers\", \n"
......@@ -387,6 +387,30 @@ TEST_F(ClientClassDefParserTest, noClassName) {
DhcpConfigError);
}
// Verifies that a class with a blank name, fails to parse.
TEST_F(ClientClassDefParserTest, blankClassName) {
std::string cfg_text =
"{ \n"
" \"name\": \"\", \n"
" \"test\": \"option[123] == 'abc'\", \n"
" \"option-data\": [ \n"
" { \n"
" \"name\": \"domain-name-servers\", \n"
" \"code\": 6, \n"
" \"space\": \"dhcp4\", \n"
" \"csv-format\": true, \n"
" \"data\": \"192.0.2.1, 192.0.2.2\" \n"
" } \n"
" ] \n"
"} \n";
ClientClassDefPtr cclass;
ASSERT_THROW(cclass = parseClientClassDef(cfg_text, Option::V4),
DhcpConfigError);
}
// Verifies that a class with an unknown element, fails to parse.
TEST_F(ClientClassDefParserTest, unknownElement) {
std::string cfg_text =
......
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