MCPcopy Create free account
hub / github.com/ddnet/ddnet / TestFileLength

Function TestFileLength

src/test/io_test.cpp:47–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47static void TestFileLength(const char *pWritten)
48{
49 const int WrittenLength = str_length(pWritten);
50
51 CTestInfo Info;
52
53 IOHANDLE File = io_open(Info.m_aFilename, IOFLAG_WRITE);
54 ASSERT_TRUE(File);
55 EXPECT_EQ(io_write(File, pWritten, WrittenLength), WrittenLength);
56 EXPECT_FALSE(io_close(File));
57
58 File = io_open(Info.m_aFilename, IOFLAG_READ);
59 ASSERT_TRUE(File);
60 EXPECT_EQ(io_length(File), WrittenLength);
61 EXPECT_FALSE(io_close(File));
62 EXPECT_FALSE(fs_remove(Info.m_aFilename));
63}
64
65TEST(Io, Length1)
66{

Callers 1

TESTFunction · 0.85

Calls 6

str_lengthFunction · 0.85
io_openFunction · 0.85
io_writeFunction · 0.85
io_closeFunction · 0.85
io_lengthFunction · 0.85
fs_removeFunction · 0.85

Tested by

no test coverage detected