mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-14 22:47:44 +00:00
(rmsgpack_test.c) Buildfix
This commit is contained in:
parent
6ddb0e418f
commit
d9ce4de9af
@ -162,42 +162,17 @@ static struct rmsgpack_read_callbacks stub_callbacks = {
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
int fd;
|
FILE *fp;
|
||||||
/*
|
|
||||||
int fd = open("test.msgpack", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
|
||||||
int rv = 0;
|
|
||||||
if (fd == -1)
|
|
||||||
{
|
|
||||||
printf("Could not open file: %s", strerror(errno));
|
|
||||||
return errno;
|
|
||||||
}
|
|
||||||
rmsgpack_write_map_header(fd, 2);
|
|
||||||
rmsgpack_write_string(fd, "compact", strlen("compact"));
|
|
||||||
rmsgpack_write_bool(fd, 1);
|
|
||||||
rmsgpack_write_string(fd, "schema", strlen("schema"));
|
|
||||||
rmsgpack_write_array_header(fd, 10);
|
|
||||||
rmsgpack_write_string(fd, "schema", strlen("schema"));
|
|
||||||
rmsgpack_write_uint(fd, 1<<17);
|
|
||||||
rmsgpack_write_int(fd, (1<<17) + 1);
|
|
||||||
rmsgpack_write_int(fd, 4);
|
|
||||||
rmsgpack_write_int(fd, -3);
|
|
||||||
rmsgpack_write_int(fd, -22);
|
|
||||||
rmsgpack_write_int(fd, -35);
|
|
||||||
rmsgpack_write_int(fd, -421421412);
|
|
||||||
rmsgpack_write_int(fd, 4214);
|
|
||||||
rmsgpack_write_int(fd, -4214);
|
|
||||||
rmsgpack_write_uint(fd, 1<<17);
|
|
||||||
close(fd);
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct stub_state state;
|
struct stub_state state;
|
||||||
|
|
||||||
state.i = 0;
|
state.i = 0;
|
||||||
state.stack[0] = 0;
|
state.stack[0] = 0;
|
||||||
fd = open("test.msgpack", O_RDONLY);
|
|
||||||
rmsgpack_read(fd, &stub_callbacks, &state);
|
fp = fopen("test.msgpack", "rb");
|
||||||
|
rmsgpack_read(fp, &stub_callbacks, &state);
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
close(fd);
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user