add test case in cpp_bootstrap_unittest.cc

pull/6467/head
Wang Kirin 6 years ago committed by Adam Cozzette
parent bf0c69e130
commit f38b6ed041
  1. 13
      src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc

@ -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

Loading…
Cancel
Save