From a2f94f0569455c50838ad3191ad55b44fc116628 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 11 Oct 1999 15:43:59 +0000 Subject: [PATCH] ICU-8 jitterbug 10: Added better diagnostic on datafile open X-SVN-Rev: 34 --- icu4c/source/test/intltest/ucdtest.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/icu4c/source/test/intltest/ucdtest.cpp b/icu4c/source/test/intltest/ucdtest.cpp index b9b8679e358..55ae14c9eae 100644 --- a/icu4c/source/test/intltest/ucdtest.cpp +++ b/icu4c/source/test/intltest/ucdtest.cpp @@ -302,14 +302,18 @@ void UnicodeTest::TestUnicodeData() char buffer[1000]; char* bufferPtr, *dirPtr; char path[256]; - + const char* datafile = "UnicodeData-3.0.0.txt"; + strcpy(path , icu_getDefaultDataDirectory()); - strcat(path, "UnicodeData-3.0.0.txt"); - - input = fopen( path, "r"); -#ifdef WIN32 - assert(input != 0); -#endif + strcat(path, datafile); + + input = fopen( path, "r"); + if (input == 0) + { + errln("Failed to open: " + UnicodeString(datafile)); + return; + } + int32_t unicode; for(;;) { bufferPtr = fgets(buffer, 999, input);