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

Function TEST

tensorflow/core/lib/io/inputstream_interface_test.cc:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50};
51
52TEST(InputStreamInterface, Basic) {
53 TestStringStream ss("This is a test string");
54 string res;
55 TF_ASSERT_OK(ss.ReadNBytes(4, &res));
56 EXPECT_EQ("This", res);
57 TF_ASSERT_OK(ss.SkipNBytes(6));
58 TF_ASSERT_OK(ss.ReadNBytes(11, &res));
59 EXPECT_EQ("test string", res);
60 // Skipping past end of the file causes OutOfRange error.
61 EXPECT_TRUE(errors::IsOutOfRange(ss.SkipNBytes(1)));
62
63 TF_ASSERT_OK(ss.Reset());
64 TF_ASSERT_OK(ss.ReadNBytes(4, &res));
65 EXPECT_EQ("This", res);
66}
67
68} // anonymous namespace
69} // namespace io

Callers

nothing calls this directly

Calls 3

ReadNBytesMethod · 0.45
SkipNBytesMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected