From e67a1c928d6ee3c0588d6b31c510c3e41ef83b38 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 9 Aug 2017 13:59:07 +0800 Subject: [PATCH] Make android compile pass --- paddle/string/to_string_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paddle/string/to_string_test.cc b/paddle/string/to_string_test.cc index 0ef06eac24..57b4010626 100644 --- a/paddle/string/to_string_test.cc +++ b/paddle/string/to_string_test.cc @@ -25,6 +25,11 @@ std::ostream& operator<<(std::ostream& s, const UserDefinedClass& ins) { return s; } +// android macro comes from +// https://stackoverflow.com/questions/15328751/android-macro-suddenly-not-defined +#if !defined(ANDROID) && !defined(__ANDROID__) +// In android, std::to_string is not defined. +// https://stackoverflow.com/questions/22774009/android-ndk-stdto-string-support TEST(to_string, normal) { using namespace paddle::string; ASSERT_EQ(std::to_string(10), to_string(10)); @@ -38,6 +43,7 @@ TEST(to_string, normal) { ASSERT_EQ(my_to_string[i], std_to_string[i]); } } +#endif TEST(to_string, user_defined) { using namespace paddle::string;