diff options
author | Victor Chang <vichang@google.com> | 2021-01-19 10:18:20 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2024-04-19 12:16:34 +0100 |
commit | c12deabf8e3fad084cb2047d2351bf1aa9d375af (patch) | |
tree | 6b9d5788fe055ee2c62c0535def30634e44f2340 | |
parent | 4fd3df792025399ac94fddc089347e7d5e127b25 (diff) | |
download | icu-c12deabf8e3fad084cb2047d2351bf1aa9d375af.tar.gz |
Android patch: Android support for ICU4C tests (Part 3)
- Fixes letest on host Linux
- ctest_dataOutDir() function has duplicated in the common lib ctestfw.
Thus, the static version in letest should be removed.
Bug: 120776993
Test: "make check" completed with some existing failures
Change-Id: I138cab6d2742b77242d396c1391cf6543bee44f1
-rw-r--r-- | icu4c/source/test/letest/letest.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/icu4c/source/test/letest/letest.cpp b/icu4c/source/test/letest/letest.cpp index 53e21cfd8..2d50a45a3 100644 --- a/icu4c/source/test/letest/letest.cpp +++ b/icu4c/source/test/letest/letest.cpp @@ -973,71 +973,6 @@ static void addAllTests(TestNode **root) #endif } -/* returns the path to icu/source/data/out */ -static const char *ctest_dataOutDir() -{ - static const char *dataOutDir = nullptr; - - if(dataOutDir) { - return dataOutDir; - } - - /* U_TOPBUILDDIR is set by the makefiles on UNIXes when building cintltst and intltst - // to point to the top of the build hierarchy, which may or - // may not be the same as the source directory, depending on - // the configure options used. At any rate, - // set the data path to the built data from this directory. - // The value is complete with quotes, so it can be used - // as-is as a string constant. - */ -#if defined (U_TOPBUILDDIR) - { - dataOutDir = U_TOPBUILDDIR "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING; - } -#else - - /* On Windows, the file name obtained from __FILE__ includes a full path. - * This file is "wherever\icu\source\test\cintltst\cintltst.c" - * Change to "wherever\icu\source\data" - */ - { - static char p[sizeof(__FILE__) + 20]; - char *pBackSlash; - int i; - - strcpy(p, __FILE__); - /* We want to back over three '\' chars. */ - /* Only Windows should end up here, so looking for '\' is safe. */ - for (i=1; i<=3; i++) { - pBackSlash = strrchr(p, U_FILE_SEP_CHAR); - if (pBackSlash != nullptr) { - *pBackSlash = 0; /* Truncate the string at the '\' */ - } - } - - if (pBackSlash != nullptr) { - /* We found and truncated three names from the path. - * Now append "source\data" and set the environment - */ - strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING); - dataOutDir = p; - } - else { - /* __FILE__ on MSVC7 does not contain the directory */ - FILE *file = fopen(".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r"); - if (file) { - fclose(file); - dataOutDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING; - } - else { - dataOutDir = ".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING; - } - } - } -#endif - - return dataOutDir; -} /* ctest_setICU_DATA - if the ICU_DATA environment variable is not already * set, try to deduce the directory in which ICU was built, |