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

Function TestRead

tensorflow/core/lib/strings/ordered_code_test.cc:103–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102template <typename T>
103T TestRead(const string& a) {
104 // gracefully reject any proper prefix of an encoding
105 for (int i = 0; i < a.size() - 1; ++i) {
106 StringPiece s(a.data(), i);
107 CHECK(!OCRead<T>(&s, nullptr));
108 CHECK_EQ(s, a.substr(0, i));
109 }
110
111 StringPiece s(a);
112 T v;
113 CHECK(OCRead<T>(&s, &v));
114 CHECK(s.empty());
115 return v;
116}
117
118template <typename T>
119void TestWriteRead(T expected) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
dataMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected