diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c index a79fc6232c..77cd7d7d80 100644 --- a/icu4c/source/test/cintltst/creststn.c +++ b/icu4c/source/test/cintltst/creststn.c @@ -203,6 +203,8 @@ void addNEWResourceBundleTest(TestNode** root) addTest(root, &TestXPath, "tsutil/creststn/TestXPath"); addTest(root, &TestCLDRStyleAliases, "tsutil/creststn/TestCLDRStyleAliases"); addTest(root, &TestFallbackCodes, "tsutil/creststn/TestFallbackCodes"); + addTest(root, &TestStackReuse, "tsutil/creststn/TestStackReuse"); + } @@ -2685,3 +2687,16 @@ static void TestFallbackCodes(void) { ures_close(r); ures_close(res); } + +static void TestStackReuse(void) { + UResourceBundle table; + UErrorCode errorCode = U_ZERO_ERROR; + UResourceBundle *rb = ures_open(NULL, "en_US", &errorCode); + const char* tableKey = "Types"; + const char* subTableKey = "collation"; + ures_initStackObject(&table); + ures_getByKeyWithFallback(rb, tableKey, &table, &errorCode); + if (subTableKey != NULL) { + ures_getByKeyWithFallback(&table,subTableKey, &table, &errorCode); + } +} \ No newline at end of file diff --git a/icu4c/source/test/cintltst/creststn.h b/icu4c/source/test/cintltst/creststn.h index 9b3ac947cc..02bf30990b 100644 --- a/icu4c/source/test/cintltst/creststn.h +++ b/icu4c/source/test/cintltst/creststn.h @@ -62,6 +62,8 @@ static void TestJB3763(void); static void TestXPath(void); +static void TestStackReuse(void); + /** * extensive subtests called by TestResourceBundles **/