Commit f38b6ed0 authored by Wang Kirin's avatar Wang Kirin Committed by Adam Cozzette

add test case in cpp_bootstrap_unittest.cc

parent bf0c69e1
......@@ -178,6 +178,19 @@ TEST(BootstrapTest, GeneratedFilesMatch) {
}
}
//test Generate in cpp_generator.cc
TEST(BootstrapTest, OptionNotExist)
{
cpp::CppGenerator generator;
DescriptorPool pool;
GeneratorContext *generator_context = nullptr;
std::string parameter = "aaa";
string error;
ASSERT_FALSE(generator.Generate(pool.FindFileByName("google/protobuf/descriptor.proto"),
parameter, generator_context, &error));
EXPECT_EQ(error, "Unknown generator option: " + parameter);
}
} // namespace
} // namespace cpp
......
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