fix failing storage test

This commit is contained in:
Enno Rehling 2016-02-13 12:51:50 +01:00
parent 45d09622cb
commit d1fdd9a89c
4 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,8 @@ without prior permission by the authors of Eressea.
#include <kernel/save.h> #include <kernel/save.h>
#include <kernel/version.h> #include <kernel/version.h>
#include <util/log.h>
#include <storage.h> #include <storage.h>
#include <stream.h> #include <stream.h>
#include <filestream.h> #include <filestream.h>
@ -26,6 +28,7 @@ without prior permission by the authors of Eressea.
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <tolua.h> #include <tolua.h>
@ -40,6 +43,7 @@ static int tolua_storage_create(lua_State * L)
tolua_pushusertype(L, (void *)data, TOLUA_CAST "storage"); tolua_pushusertype(L, (void *)data, TOLUA_CAST "storage");
return 1; return 1;
} }
log_error("could not open %s, mode %s (%s).", filename, type, strerror(errno));
return 0; return 0;
} }

View File

@ -75,6 +75,7 @@ int RunAllTests(int argc, char *argv[])
ADD_SUITE(base36); ADD_SUITE(base36);
ADD_SUITE(bsdstring); ADD_SUITE(bsdstring);
ADD_SUITE(functions); ADD_SUITE(functions);
ADD_SUITE(gamedata);
ADD_SUITE(parser); ADD_SUITE(parser);
ADD_SUITE(password); ADD_SUITE(password);
ADD_SUITE(umlaut); ADD_SUITE(umlaut);

View File

@ -2,6 +2,7 @@ project(util C)
SET(_TEST_FILES SET(_TEST_FILES
base36.test.c base36.test.c
gamedata.test.c
parser.test.c parser.test.c
password.test.c password.test.c
attrib.test.c attrib.test.c

View File

@ -69,5 +69,5 @@ gamedata *gamedata_open(const char *filename, const char *mode, int version) {
free(data); free(data);
return NULL; return NULL;
} }
return 0; return data;
} }