ICU-3499 Verify that the test file can be removed during testing.
X-SVN-Rev: 14970
This commit is contained in:
parent
d3852a94e8
commit
d1bc58f6a0
@ -104,6 +104,11 @@ u_fopen(const char *filename,
|
||||
if (result) {
|
||||
result->fOwnFile = TRUE;
|
||||
}
|
||||
else {
|
||||
/* Something bad happened.
|
||||
Maybe the converter couldn't be opened. */
|
||||
fclose(systemFile);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static char STANDARD_TEST_FILE[] = "iotest-c.txt";
|
||||
const char STANDARD_TEST_FILE[] = "iotest-c.txt";
|
||||
|
||||
|
||||
static void TestFileFromICU(UFILE *myFile) {
|
||||
|
@ -372,6 +372,20 @@ int main(int argc, char* argv[])
|
||||
addAllTests(&root);
|
||||
nerrors = processArgs(root, argc, argv);
|
||||
|
||||
#if 1
|
||||
{
|
||||
FILE* fileToRemove = fopen(STANDARD_TEST_FILE, "r");
|
||||
/* This should delete any temporary files. */
|
||||
if (fileToRemove) {
|
||||
fclose(fileToRemove);
|
||||
if (remove(STANDARD_TEST_FILE) != 0) {
|
||||
/* Maybe someone didn't close the file correctly. */
|
||||
fprintf(stderr, "FAIL: Could not delete %s\n", STANDARD_TEST_FILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanUpTestTree(root);
|
||||
u_cleanup();
|
||||
return nerrors;
|
||||
|
@ -26,6 +26,7 @@ addFileTest(TestNode** root);
|
||||
|
||||
U_CDECL_BEGIN
|
||||
extern const UChar NEW_LINE[];
|
||||
extern const char STANDARD_TEST_FILE[];
|
||||
U_CDECL_END
|
||||
|
||||
#define STANDARD_TEST_NUM_RANGE 1000
|
||||
|
Loading…
Reference in New Issue
Block a user