MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / TEST

Function TEST

cfile/tests/cfile_tests.cpp:25–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include "cfile.h"
24
25TEST(D3, CFileIO) {
26 int lib_handle = cf_OpenLibrary("TestDir/test.hog");
27 CFILE *file_handle = cfopen("lowercase.txt", "rb");
28 char buf[5];
29 cf_ReadString(buf, 5, file_handle);
30 EXPECT_STREQ(buf, "TEST");
31 cf_Rewind(file_handle);
32
33 EXPECT_EQ(cf_ReadByte(file_handle), 84);
34 cf_Rewind(file_handle);
35
36 EXPECT_EQ(cf_ReadShort(file_handle), 17748);
37 cf_Rewind(file_handle);
38
39 EXPECT_EQ(cf_ReadInt(file_handle), 1414743380);
40 cf_Rewind(file_handle);
41
42 cf_CloseLibrary(lib_handle);
43}
44
45TEST(D3, CFileLibrary) {
46 // First pass - without search path in "TestDir" (i.e. not search actual files in directory)

Callers

nothing calls this directly

Calls 15

cf_OpenLibraryFunction · 0.85
cfopenFunction · 0.85
cf_ReadStringFunction · 0.85
cf_RewindFunction · 0.85
cf_ReadByteFunction · 0.85
cf_ReadShortFunction · 0.85
cf_ReadIntFunction · 0.85
cf_CloseLibraryFunction · 0.85
cf_SetSearchPathFunction · 0.85
cf_OpenFileInLibraryFunction · 0.85
cfilelengthFunction · 0.85
cf_CalculateFileCRCFunction · 0.85

Tested by

no test coverage detected