MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/cc/framework/cc_op_gen_test.cc:103–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103TEST(CcOpGenTest, TestVisibilityChangedToHidden) {
104 const string api_def = R"(
105op {
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
130TEST(CcOpGenTest, TestArgNameChanges) {
131 const string api_def = R"(

Callers

nothing calls this directly

Calls 6

DefaultFunction · 0.85
GenerateCcOpFilesFunction · 0.85
ExpectDoesNotHaveSubstrFunction · 0.85
ExpectSubstrOrderFunction · 0.85
LoadApiDefMethod · 0.80
ExpectHasSubstrFunction · 0.70

Tested by

no test coverage detected