From ada7babc2ddb0f2f4574b0aa07dbe63e9de9e4d9 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 5 Feb 2016 07:27:02 -0800 Subject: [PATCH] Turn off a FBStringTest for Android. Summary: The wstring support on KitKat is not exactly working. Works on Lollipop though. Reviewed By: markisaa Differential Revision: D2901732 fb-gh-sync-id: 97b57fb4d8c645192be62dca25d8fb1b2397ad7d --- folly/test/FBStringTest.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/folly/test/FBStringTest.cpp b/folly/test/FBStringTest.cpp index fdd8d88f..c3259142 100644 --- a/folly/test/FBStringTest.cpp +++ b/folly/test/FBStringTest.cpp @@ -981,9 +981,13 @@ template void clause11_21_4_8_9_a(String & test) { TEST(FBString, testAllClauses) { EXPECT_TRUE(1) << "Starting with seed: " << seed; std::string r; - std::wstring wr; folly::fbstring c; +#ifndef __ANDROID__ + // Disabled on Android: wchar support is not recommended and does not + // always behave as expected + std::wstring wr; folly::basic_fbstring wc; +#endif int count = 0; auto l = [&](const char * const clause, @@ -995,8 +999,10 @@ TEST(FBString, testAllClauses) { randomString(&r); c = r; EXPECT_EQ(c, r); +#ifndef __ANDROID__ wr = std::wstring(r.begin(), r.end()); wc = folly::basic_fbstring(wr.c_str()); +#endif auto localSeed = seed + count; rng = RandomT(localSeed); f_string(r); @@ -1006,6 +1012,7 @@ TEST(FBString, testAllClauses) { << "Lengths: " << r.size() << " vs. " << c.size() << "\nReference: '" << r << "'" << "\nActual: '" << c.data()[0] << "'"; +#ifndef __ANDROID__ rng = RandomT(localSeed); f_wfbstring(wc); int wret = wcslen(wc.c_str()); @@ -1016,6 +1023,7 @@ TEST(FBString, testAllClauses) { std::string one(mb); std::string two(mc); EXPECT_EQ(one, two); +#endif } while (++count % 100 != 0); }; -- 2.34.1