X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Ficu%2Fsource%2Ftest%2Fcintltst%2Fudatatst.c;h=70c4f66baa1179b428fda370f4e582a21c17c692;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=a454245263dc36ef20e569cbf63f3138d550e913;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/icu/source/test/cintltst/udatatst.c b/src/third_party/icu/source/test/cintltst/udatatst.c index a454245..70c4f66 100644 --- a/src/third_party/icu/source/test/cintltst/udatatst.c +++ b/src/third_party/icu/source/test/cintltst/udatatst.c @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1998-2010, International Business Machines Corporation and + * Copyright (c) 1998-2013, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /* @@ -27,19 +27,10 @@ #include "udatamem.h" #include "cintltst.h" #include "ubrkimpl.h" - -#include -#include -#include +#include "toolutil.h" /* for uprv_fileExists() */ #include #include -#ifdef U_WINDOWS -#include -#else -#include -#endif - /* includes for TestSwapData() */ #include "udataswp.h" @@ -52,7 +43,6 @@ #include "ucol_swp.h" #include "ucnv_bld.h" #include "sprpimpl.h" -#include "propname.h" #include "rbbidata.h" /* swapping implementation in i18n */ @@ -67,16 +57,18 @@ unorm2_swap(const UDataSwapper *ds, #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#if !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION static void TestUDataOpen(void); static void TestUDataOpenChoiceDemo1(void); static void TestUDataOpenChoiceDemo2(void); static void TestUDataGetInfo(void); static void TestUDataGetMemory(void); -static void TestUDataSetAppData(void); static void TestErrorConditions(void); static void TestAppData(void); -static void TestICUDataName(void); static void TestSwapData(void); +#endif +static void TestUDataSetAppData(void); +static void TestICUDataName(void); static void PointerTableOfContents(void); static void SetBadCommonData(void); static void TestUDataFileAccess(void); @@ -117,12 +109,12 @@ static void lots_of_mallocs() } #endif +#if !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION static void TestUDataOpen(){ UDataMemory *result; UErrorCode status=U_ZERO_ERROR; const char* memMap[][2]={ {"root", "res"}, - {"pnames", "icu"}, {"cnvalias", "icu"}, {"unames", "icu"}, {"ibm-37_P100-1995", "cnv"} @@ -135,10 +127,9 @@ static void TestUDataOpen(){ char* path=(char*)malloc(sizeof(char) * (strlen(ctest_dataOutDir()) + strlen(U_ICUDATA_NAME) - + strlen("/build")+1 ) ); + + strlen("/build/tmp/..")+1 ) ); char *icuDataFilePath = 0; - struct stat stat_buf; const char* testPath=loadTestData(&status); if(U_FAILURE(status)) { @@ -148,10 +139,7 @@ static void TestUDataOpen(){ } /* lots_of_mallocs(); */ - - strcat(strcpy(path, ctest_dataOutDir()), U_ICUDATA_NAME); - - log_verbose("Testing udata_open()\n"); + log_verbose("Testing udata_open(%s)\n", testPath); result=udata_open(testPath, type, name, &status); if(U_FAILURE(status)){ log_data_err("FAIL: udata_open() failed for path = %s, name=%s, type=%s, \n errorcode=%s\n", testPath, name, type, myErrorName(status)); @@ -160,20 +148,23 @@ static void TestUDataOpen(){ udata_close(result); } - /* If the ICU system common data file is present in this confiugration, - * verify that udata_open can explicitly fetch items from it. - * If packaging mode == dll, the file may not exist. So, if the file is - * missing, skip this test without error. - */ - icuDataFilePath = (char *)malloc(strlen(path) + 10); - strcpy(icuDataFilePath, path); - strcat(icuDataFilePath, ".dat"); - /* lots_of_mallocs(); */ - if (stat(icuDataFilePath, &stat_buf) == 0) { - int i; - log_verbose("Testing udata_open() on %s\n", icuDataFilePath); - for(i=0; i