Turn off a FBStringTest for Android.
authorMichael Lee <mzlee@fb.com>
Fri, 5 Feb 2016 15:27:02 +0000 (07:27 -0800)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Fri, 5 Feb 2016 16:20:22 +0000 (08:20 -0800)
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

index fdd8d88f2ed936318ca4e64d5582d68fb0a8f80b..c32591424062dfe63a854b29809ae63e2d905cdc 100644 (file)
@@ -981,9 +981,13 @@ template <class String> 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<wchar_t> 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<wchar_t>(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);
   };