Testing Spices::FileLibrary::Read_Line.
138 {
139
141
144
145 EXPECT_EQ(handle.is_valid, true);
146 EXPECT_NE(handle.handle, nullptr);
147
148
149 {
150 char data[100];
151 uint64_t bytes;
153 EXPECT_EQ(bytes, 29);
154
155 std::string firstLineRead(data, bytes);
156 std::string firstLine = "-- @file SpicesTest Premake.\n";
157
158 EXPECT_STREQ(firstLineRead.c_str(), firstLine.c_str());
159 }
160
161
162 {
163 char data[100];
164 uint64_t bytes;
166 EXPECT_EQ(bytes, 61);
167
168 std::string firstLineRead(data, bytes);
169 std::string firstLine = "-- @brief Defines details of the UintTest Solution Building.\n";
170
171 EXPECT_STREQ(firstLineRead.c_str(), firstLine.c_str());
172 }
173
174
175 {
176 char data[100];
177 uint64_t bytes;
179 EXPECT_EQ(bytes, 32);
180
181 std::string firstLineRead(data, bytes);
182 std::string firstLine = "-- @author The Cherno & Spices.\n";
183
184 EXPECT_STREQ(firstLineRead.c_str(), firstLine.c_str());
185 }
186
188 }
#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_Line(const FileHandle *handle, uint64_t max_length, char *line_buf, uint64_t *out_line_length)
Read one line from the current file handle pointer, and move pointer the same size.
@ FILE_MODE_READ
model : read
This Struct is FILE* handle pointer Wrapper.