The test ensures that `builtin_ops.h` is consistent with the FlatBuffer schema definition. When the schema is modified, it's required to run the generator to re-generate the header. Please see README.md for more details.
| 27 | // generator to re-generate the header. |
| 28 | // Please see README.md for more details. |
| 29 | TEST(BuiltinOpsHeaderTest, TestConsistency) { |
| 30 | std::ifstream input_stream(kHeaderFileName, std::ios::binary); |
| 31 | ASSERT_TRUE(input_stream); |
| 32 | std::string file_content((std::istreambuf_iterator<char>(input_stream)), |
| 33 | std::istreambuf_iterator<char>()); |
| 34 | |
| 35 | std::ostringstream output_stream; |
| 36 | tflite::builtin_ops_header::GenerateHeader(output_stream); |
| 37 | std::string generated_content = output_stream.str(); |
| 38 | |
| 39 | EXPECT_EQ(file_content, generated_content); |
| 40 | } |
| 41 | |
| 42 | } // anonymous namespace |
| 43 |
nothing calls this directly
no test coverage detected