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

Function TEST_F

tensorflow/core/platform/env_test.cc:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74};
75
76TEST_F(DefaultEnvTest, IncompleteReadOutOfRange) {
77 const string filename = io::JoinPath(BaseDir(), "out_of_range");
78 const string input = CreateTestFile(env_, filename, 2);
79 std::unique_ptr<RandomAccessFile> f;
80 TF_EXPECT_OK(env_->NewRandomAccessFile(filename, &f));
81
82 // Reading past EOF should give an OUT_OF_RANGE error
83 StringPiece result;
84 char scratch[3];
85 EXPECT_EQ(error::OUT_OF_RANGE, f->Read(0, 3, &result, scratch).code());
86 EXPECT_EQ(input, result);
87
88 // Exact read to EOF works.
89 TF_EXPECT_OK(f->Read(0, 2, &result, scratch));
90 EXPECT_EQ(input, result);
91}
92
93TEST_F(DefaultEnvTest, ReadFileToString) {
94 for (const int length : {0, 1, 1212, 2553, 4928, 8196, 9000, (1 << 20) - 1,

Callers

nothing calls this directly

Calls 15

BaseDirFunction · 0.85
CreateTestFileFunction · 0.85
ReadFileToStringFunction · 0.85
CreateTestProtoFunction · 0.85
WriteBinaryProtoFunction · 0.85
ReadBinaryProtoFunction · 0.85
WriteStringToFileFunction · 0.85
ReadTextProtoFunction · 0.85
DefaultFunction · 0.85
StartsWithFunction · 0.85
EndsWithFunction · 0.85
FlushFileSystemCachesMethod · 0.80

Tested by

no test coverage detected