16 #define _CRT_NONSTDC_NO_WARNINGS 32 #define FBASENAME1 "../Documents/sdldata1" 33 #define FBASENAME2 "../Documents/sdldata2" 35 #define FBASENAME1 "sdldata1" 36 #define FBASENAME2 "sdldata2" 40 #define NULL ((void *)0) 61 #define RWOP_ERR_QUIT(x) rwops_error_quit( __LINE__, (x) ) 66 main(
int argc,
char *argv[])
134 if (1 != rwops->
write(rwops,
"1234567890", 10, 1))
136 if (10 != rwops->
write(rwops,
"1234567890", 1, 10))
138 if (7 != rwops->
write(rwops,
"1234567", 1, 7))
142 if (0 != rwops->
read(rwops, test_buf, 1, 1))
153 if (7 != rwops->
read(rwops, test_buf, 1, 7))
157 if (0 != rwops->
read(rwops, test_buf, 1, 1))
159 if (0 != rwops->
read(rwops, test_buf, 10, 100))
163 if (2 != rwops->
read(rwops, test_buf, 10, 3))
165 if (
SDL_memcmp(test_buf,
"12345678901234567890", 20))
167 if (0 != rwops->
write(rwops, test_buf, 1, 1))
175 if (1 != rwops->
write(rwops,
"1234567890", 10, 1))
177 if (10 != rwops->
write(rwops,
"1234567890", 1, 10))
179 if (7 != rwops->
write(rwops,
"1234567", 1, 7))
183 if (1 != rwops->
read(rwops, test_buf, 1, 1))
189 if (7 != rwops->
read(rwops, test_buf, 1, 7))
193 if (0 != rwops->
read(rwops, test_buf, 1, 1))
195 if (0 != rwops->
read(rwops, test_buf, 10, 100))
199 if (2 != rwops->
read(rwops, test_buf, 10, 3))
201 if (
SDL_memcmp(test_buf,
"12345678901234567890", 20))
210 if (1 != rwops->
write(rwops,
"1234567890", 10, 1))
212 if (10 != rwops->
write(rwops,
"1234567890", 1, 10))
214 if (7 != rwops->
write(rwops,
"1234567", 1, 7))
218 if (1 != rwops->
read(rwops, test_buf, 1, 1))
224 if (7 != rwops->
read(rwops, test_buf, 1, 7))
228 if (0 != rwops->
read(rwops, test_buf, 1, 1))
230 if (0 != rwops->
read(rwops, test_buf, 10, 100))
234 if (2 != rwops->
read(rwops, test_buf, 10, 3))
236 if (
SDL_memcmp(test_buf,
"12345678901234567890", 20))
245 if (1 != rwops->
write(rwops,
"1234567890", 10, 1))
247 if (10 != rwops->
write(rwops,
"1234567890", 1, 10))
249 if (7 != rwops->
write(rwops,
"1234567", 1, 7))
254 if (1 != rwops->
read(rwops, test_buf, 1, 1))
261 if (7 != rwops->
read(rwops, test_buf, 1, 7))
265 if (0 != rwops->
read(rwops, test_buf, 1, 1))
267 if (0 != rwops->
read(rwops, test_buf, 10, 100))
275 if (3 != rwops->
read(rwops, test_buf, 10, 3))
277 if (
SDL_memcmp(test_buf,
"123456789012345678901234567123", 30))
size_t(* write)(struct SDL_RWops *context, const void *ptr, size_t size, size_t num)
Sint64(* seek)(struct SDL_RWops *context, Sint64 offset, int whence)
static void rwops_error_quit(unsigned line, SDL_RWops *rwops)
int(* close)(struct SDL_RWops *context)
int main(int argc, char *argv[])
#define SDL_LogSetPriority
size_t(* read)(struct SDL_RWops *context, void *ptr, size_t size, size_t maxnum)
static void cleanup(void)