@@ -15,11 +15,11 @@ #include "config.h" #import "TestsAppDelegate.h" -static OFString *module = @"OFINIFile"; +static OFString *module; @implementation TestsAppDelegate (OFINIFileTests) - (void)INIFileTests { void *pool = objc_autoreleasePoolPush(); @@ -47,10 +47,12 @@ OFINICategory *tests, *foobar, *types; OFArray *array; #ifndef OF_NINTENDO_DS OFString *writePath; #endif + + module = @"OFINIFile"; TEST(@"+[fileWithPath:encoding:]", (file = [OFINIFile fileWithPath: @"testfile.ini" encoding: OFStringEncodingCodepage437])) @@ -110,27 +112,21 @@ module = @"OFINIFile"; /* FIXME: Find a way to write files on Nintendo DS */ #ifndef OF_NINTENDO_DS -# ifndef OF_IOS - writePath = @"tmpfile.ini"; -# else - writePath = [OFString pathWithComponents: [OFArray arrayWithObjects: - [[OFApplication environment] objectForKey: @"HOME"], - @"tmp", @"tmpfile.ini", nil]]; -# endif + writePath = [[OFSystemInfo temporaryDirectoryPath] + stringByAppendingPathComponent: @"objfw-tests.ini"]; TEST(@"-[writeToFile:encoding:]", R([file writeToFile: writePath encoding: OFStringEncodingCodepage437]) && - [[OFString - stringWithContentsOfFile: writePath - encoding: OFStringEncodingCodepage437] + [[OFString stringWithContentsOfFile: writePath + encoding: OFStringEncodingCodepage437] isEqual: output]) [[OFFileManager defaultManager] removeItemAtPath: writePath]; #else (void)output; #endif objc_autoreleasePoolPop(pool); } @end