SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [16/59]

SpicesTest::TEST ( FileLibraryTest ,
Read_all_bytes  )

Testing Spices::FileLibrary::Read_all_bytes.

Todo
Returns false here, but not known why?

Definition at line 193 of file FileLibrary_test.h.

193 {
194
196
197 Spices::FileHandle handle{};
198 EXPECT_EQ(Spices::FileLibrary::FileLibrary_Open("premake5.lua", Spices::FileModes::FILE_MODE_READ, false, &handle), true);
199
200 EXPECT_EQ(handle.is_valid, true);
201 EXPECT_NE(handle.handle, nullptr);
202
203 {
204 char data[6000];
205 uint64_t bytes;
206
211 }
212
214 }
#define SPICESTEST_PROFILE_FUNCTION()
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.
static bool FileLibrary_Read_all_bytes(const FileHandle *handle, char *out_bytes, uint64_t *out_bytes_read)
Read all data form the current file handle pointer.
@ 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_Read_all_bytes(), Spices::FileHandle::handle, and Spices::FileHandle::is_valid.