SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [18/59]

SpicesTest::TEST ( FileLibraryTest ,
Size  )

Testing Spices::FileLibrary::Size.

Definition at line 63 of file FileLibrary_test.h.

63 {
64
66
67 Spices::FileHandle handle{};
68 EXPECT_EQ(Spices::FileLibrary::FileLibrary_Open("premake5.lua", Spices::FileModes::FILE_MODE_READ, false, &handle), true);
69
70 EXPECT_EQ(handle.is_valid, true);
71 EXPECT_NE(handle.handle, nullptr);
72
73 uint64_t size;
74 EXPECT_EQ(Spices::FileLibrary::FileLibrary_Size(&handle, &size), true);
75 EXPECT_EQ(size, 5767);
76
78 }
#define SPICESTEST_PROFILE_FUNCTION()
static bool FileLibrary_Size(const FileHandle *handle, uint64_t *out_size)
Calculate The file size.
static bool FileLibrary_Open(const char *path, FileModes mode, bool binary, FileHandle *out_handle)
Open the file using given string.
static void FileLibrary_Close(FileHandle *handle)
Close the file by the file handle.
@ FILE_MODE_READ
model : read
Definition FileLibrary.h:37
This Struct is FILE* handle pointer Wrapper.
Definition FileLibrary.h:15

References Spices::FILE_MODE_READ, Spices::FileLibrary::FileLibrary_Close(), Spices::FileLibrary::FileLibrary_Open(), Spices::FileLibrary::FileLibrary_Size(), Spices::FileHandle::handle, and Spices::FileHandle::is_valid.