blob: 421342fb634ed3818cb4d765487c63d5b39d0096 [file] [log] [blame]
From 3b92917541fa4ece24aeeacbb6863c8a20dfda96 Mon Sep 17 00:00:00 2001
From: Andrew Hsieh <andrewhsieh@google.com>
Date: Wed, 12 Feb 2014 20:12:26 +0800
Subject: [PATCH 6/6] temp fix: disable part of some tests for Android
Parts of sub tests will certainly fail Android and fixing them
take significantly longer time. Disabling them to allow rest
parts to run and create less noise in test log so other issues
can be uncovered
---
test/depr/depr.c.headers/math_h.pass.cpp | 4 ++++
test/depr/depr.c.headers/stdio_h.pass.cpp | 6 ++++++
.../exception.unexpected/set.unexpected/get_unexpected.pass.cpp | 4 ++++
.../exception.unexpected/set.unexpected/set_unexpected.pass.cpp | 4 ++++
test/input.output/file.streams/c.files/cstdio.pass.cpp | 6 ++++++
.../file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp | 4 ++++
.../file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp | 4 ++++
test/input.output/iostream.format/ext.manip/get_money.pass.cpp | 4 ++++
test/input.output/iostream.format/ext.manip/get_time.pass.cpp | 4 ++++
test/input.output/iostream.format/ext.manip/put_money.pass.cpp | 4 ++++
test/numerics/c.math/cmath.pass.cpp | 5 +++++
11 files changed, 49 insertions(+)
diff --git a/test/depr/depr.c.headers/math_h.pass.cpp b/test/depr/depr.c.headers/math_h.pass.cpp
index 9e93966..cd07710 100644
--- a/test/depr/depr.c.headers/math_h.pass.cpp
+++ b/test/depr/depr.c.headers/math_h.pass.cpp
@@ -229,7 +229,11 @@ void test_isinf()
void test_isnan()
{
static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
+#if !defined(__ANDROID__)
+ // bionic isnan(double) returns int. Not sure how isnan(float) and isnan(long double) pass.
+ // Mask this check to reveal/fix more seirous one: eg. lack of log2 and nettoward, etc
static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
+#endif
static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
assert(isnan(-1.0) == false);
}
diff --git a/test/depr/depr.c.headers/stdio_h.pass.cpp b/test/depr/depr.c.headers/stdio_h.pass.cpp
index 8e236e3..058b300 100644
--- a/test/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/test/depr/depr.c.headers/stdio_h.pass.cpp
@@ -130,7 +130,13 @@ int main()
static_assert((std::is_same<decltype(ftell(fp)), long>::value), "");
static_assert((std::is_same<decltype(rewind(fp)), void>::value), "");
static_assert((std::is_same<decltype(clearerr(fp)), void>::value), "");
+#if !defined(feof)
+ //check return type of feof only if it's not an macro which may be a compound expression
static_assert((std::is_same<decltype(feof(fp)), int>::value), "");
+#endif
+#if !defined(ferror)
+ //check return type of ferror only if it's not an macro which may be a compound expression
static_assert((std::is_same<decltype(ferror(fp)), int>::value), "");
+#endif
static_assert((std::is_same<decltype(perror("")), void>::value), "");
}
diff --git a/test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp b/test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp
index 8b0a0b9..c2d7d75 100644
--- a/test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp
+++ b/test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp
@@ -34,6 +34,10 @@ int main()
assert(std::get_unexpected() == f2);
// verify calling original unexpected handler calls terminate
std::set_terminate(f3);
+#if !defined(__ANDROID__)
+ // Disable the following for Android whoes __gabixx::__default_terminate()
+ // causes segfault on purpose to get stack dump
(*old)();
assert(0);
+#endif
}
diff --git a/test/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp b/test/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp
index ed02fa6..425b606 100644
--- a/test/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp
+++ b/test/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp
@@ -30,6 +30,10 @@ int main()
assert(std::set_unexpected(f2) == f1);
// verify calling original unexpected handler calls terminate
std::set_terminate(f3);
+#if !defined(__ANDROID__)
+ // Disable the following for Android whoes __gabixx::__default_terminate()
+ // causes segfault on purpose to get stack dump
(*old)();
assert(0);
+#endif
}
diff --git a/test/input.output/file.streams/c.files/cstdio.pass.cpp b/test/input.output/file.streams/c.files/cstdio.pass.cpp
index 1a60dd6..e28d0cf 100644
--- a/test/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/test/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -133,7 +133,13 @@ int main()
static_assert((std::is_same<decltype(std::ftell(fp)), long>::value), "");
static_assert((std::is_same<decltype(std::rewind(fp)), void>::value), "");
static_assert((std::is_same<decltype(std::clearerr(fp)), void>::value), "");
+#if !defined(feof)
+ //check return type of feof only if it's not an macro which may be a compound expression
static_assert((std::is_same<decltype(std::feof(fp)), int>::value), "");
+#endif
+#if !defined(ferror)
+ //check return type of ferror only if it's not an macro which may be a compound expression
static_assert((std::is_same<decltype(std::ferror(fp)), int>::value), "");
+#endif
static_assert((std::is_same<decltype(std::perror("")), void>::value), "");
}
diff --git a/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
index 1da3856..f6dc14e 100644
--- a/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
+++ b/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
@@ -115,6 +115,9 @@ int main()
assert(f.sgetc() == L'a');
}
std::remove("overflow.dat");
+#if !defined(__ANDROID__)
+ // Remove tests setlocale() to other than "", "C", and "POSIX"
+ // for Android
{
test_buf<wchar_t> f;
f.pubimbue(std::locale(LOCALE_en_US_UTF_8));
@@ -139,4 +142,5 @@ int main()
assert(f.sbumpc() == -1);
}
std::remove("overflow.dat");
+#endif // __ANDROID__
}
diff --git a/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
index e34bc84..a66d9d3 100644
--- a/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
+++ b/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
@@ -108,6 +108,9 @@ int main()
assert(*f.gptr() == L'9');
assert(f.egptr() - f.gptr() == 1);
}
+#if !defined(__ANDROID__)
+ // Remove tests setlocale() to other than "", "C", and "POSIX"
+ // for Android
{
test_buf<wchar_t> f;
f.pubimbue(std::locale(LOCALE_en_US_UTF_8));
@@ -118,4 +121,5 @@ int main()
assert(f.sbumpc() == 0x4E53);
assert(f.sbumpc() == -1);
}
+#endif // __ANDROID__
}
diff --git a/test/input.output/iostream.format/ext.manip/get_money.pass.cpp b/test/input.output/iostream.format/ext.manip/get_money.pass.cpp
index cdd762a..5b7c69d 100644
--- a/test/input.output/iostream.format/ext.manip/get_money.pass.cpp
+++ b/test/input.output/iostream.format/ext.manip/get_money.pass.cpp
@@ -38,6 +38,9 @@ public:
int main()
{
+#if !defined(__ANDROID__)
+ // Remove tests setlocale() to other than "", "C", and "POSIX"
+ // for Android
{
testbuf<char> sb(" -$1,234,567.89");
std::istream is(&sb);
@@ -70,4 +73,5 @@ int main()
is >> std::get_money(x, true);
assert(x == -123456789);
}
+#endif
}
diff --git a/test/input.output/iostream.format/ext.manip/get_time.pass.cpp b/test/input.output/iostream.format/ext.manip/get_time.pass.cpp
index 6866552..7a11319 100644
--- a/test/input.output/iostream.format/ext.manip/get_time.pass.cpp
+++ b/test/input.output/iostream.format/ext.manip/get_time.pass.cpp
@@ -54,6 +54,9 @@ int main()
assert(is.eof());
assert(!is.fail());
}
+#if !defined(__ANDROID__)
+ // Remove tests setlocale() to other than "", "C", and "POSIX"
+ // for Android
{
testbuf<wchar_t> sb(L" Sat Dec 31 23:55:59 2061");
std::wistream is(&sb);
@@ -70,4 +73,5 @@ int main()
assert(is.eof());
assert(!is.fail());
}
+#endif
}
diff --git a/test/input.output/iostream.format/ext.manip/put_money.pass.cpp b/test/input.output/iostream.format/ext.manip/put_money.pass.cpp
index 8d15dd9..aca45cd 100644
--- a/test/input.output/iostream.format/ext.manip/put_money.pass.cpp
+++ b/test/input.output/iostream.format/ext.manip/put_money.pass.cpp
@@ -50,6 +50,9 @@ protected:
int main()
{
+#if !defined(__ANDROID__)
+ // Remove tests setlocale() to other than "", "C", and "POSIX"
+ // for Android
{
testbuf<char> sb;
std::ostream os(&sb);
@@ -86,4 +89,5 @@ int main()
os << std::put_money(x, true);
assert(sb.str() == L"-USD 1,234,567.89");
}
+#endif // __ANDROID__
}
diff --git a/test/numerics/c.math/cmath.pass.cpp b/test/numerics/c.math/cmath.pass.cpp
index 5db9fd1..e2705f7 100644
--- a/test/numerics/c.math/cmath.pass.cpp
+++ b/test/numerics/c.math/cmath.pass.cpp
@@ -493,8 +493,13 @@ void test_isnan()
#error isnan defined
#endif
static_assert((std::is_same<decltype(std::isnan((float)0)), bool>::value), "");
+#if !defined(__ANDROID__)
+ // bionic isnan(double) returns int. Not sure how isnan(float) and isnan(long double) pass.
+ // Mask this check to reveal/fix more seirous one: eg. lack of log2 and nettoward, etc
+
static_assert((std::is_same<decltype(std::isnan((double)0)), bool>::value), "");
static_assert((std::is_same<decltype(std::isnan(0)), bool>::value), "");
+#endif
static_assert((std::is_same<decltype(std::isnan((long double)0)), bool>::value), "");
assert(std::isnan(-1.0) == false);
}
--
1.9.0.rc1.175.g0b1dcb5