| 101 | } |
| 102 | |
| 103 | TEST(CcOpGenTest, TestVisibilityChangedToHidden) { |
| 104 | const string api_def = R"( |
| 105 | op { |
| 106 | graph_op_name: "Foo" |
| 107 | visibility: HIDDEN |
| 108 | } |
| 109 | )"; |
| 110 | Env* env = Env::Default(); |
| 111 | OpList op_defs; |
| 112 | protobuf::TextFormat::ParseFromString(kBaseOpDef, &op_defs); // NOLINT |
| 113 | ApiDefMap api_def_map(op_defs); |
| 114 | |
| 115 | string h_file_text, internal_h_file_text; |
| 116 | // Without ApiDef |
| 117 | GenerateCcOpFiles(env, op_defs, api_def_map, &h_file_text, |
| 118 | &internal_h_file_text); |
| 119 | ExpectHasSubstr(h_file_text, "class Foo"); |
| 120 | ExpectDoesNotHaveSubstr(internal_h_file_text, "class Foo"); |
| 121 | |
| 122 | // With ApiDef |
| 123 | TF_ASSERT_OK(api_def_map.LoadApiDef(api_def)); |
| 124 | GenerateCcOpFiles(env, op_defs, api_def_map, &h_file_text, |
| 125 | &internal_h_file_text); |
| 126 | ExpectHasSubstr(internal_h_file_text, "class Foo"); |
| 127 | ExpectDoesNotHaveSubstr(h_file_text, "class Foo"); |
| 128 | } |
| 129 | |
| 130 | TEST(CcOpGenTest, TestArgNameChanges) { |
| 131 | const string api_def = R"( |
nothing calls this directly
no test coverage detected