summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-08-16 00:47:22 (GMT)
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-08-16 00:47:22 (GMT)
commitcf3f92ef93ffc35ec1efe8b3b1d65b2624d84de5 (patch)
tree677ab1ab91c33415d240c8eb9d628159557cf3fe
parentc2922d4ed2ecff5ba889b2008dba45dbc39c9168 (diff)
downloadgoogletest-cf3f92ef93ffc35ec1efe8b3b1d65b2624d84de5.zip
googletest-cf3f92ef93ffc35ec1efe8b3b1d65b2624d84de5.tar.gz
googletest-cf3f92ef93ffc35ec1efe8b3b1d65b2624d84de5.tar.bz2
Fixes a user reported test break (modifying a dict while iterating).
-rw-r--r--include/gtest/internal/gtest-port.h7
-rw-r--r--include/gtest/internal/gtest-type-util.h12
-rw-r--r--include/gtest/internal/gtest-type-util.h.pump12
-rwxr-xr-xtest/gtest_test_utils.py2
4 files changed, 20 insertions, 13 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 891ac8a..8a76088 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -678,6 +678,13 @@
# define GTEST_NO_INLINE_
#endif
+// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
+#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
+# define GTEST_HAS_CXXABI_H_ 1
+#else
+# define GTEST_HAS_CXXABI_H_ 0
+#endif
+
namespace testing {
class Message;
diff --git a/include/gtest/internal/gtest-type-util.h b/include/gtest/internal/gtest-type-util.h
index b7b01b0..597aeaf 100644
--- a/include/gtest/internal/gtest-type-util.h
+++ b/include/gtest/internal/gtest-type-util.h
@@ -49,11 +49,11 @@
// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
// libstdc++ (which is where cxxabi.h comes from).
-# ifdef __GLIBCXX__
+# if GTEST_HAS_CXXABI_H_
# include <cxxabi.h>
# elif defined(__HP_aCC)
# include <acxx_demangle.h>
-# endif // __GLIBCXX__
+# endif // GTEST_HASH_CXXABI_H_
namespace testing {
namespace internal {
@@ -66,20 +66,20 @@ String GetTypeName() {
# if GTEST_HAS_RTTI
const char* const name = typeid(T).name();
-# if defined(__GLIBCXX__) || defined(__HP_aCC)
+# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
int status = 0;
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
-# ifdef __GLIBCXX__
+# if GTEST_HAS_CXXABI_H_
using abi::__cxa_demangle;
-# endif // __GLIBCXX__
+# endif // GTEST_HAS_CXXABI_H_
char* const readable_name = __cxa_demangle(name, 0, 0, &status);
const String name_str(status == 0 ? readable_name : name);
free(readable_name);
return name_str;
# else
return name;
-# endif // __GLIBCXX__ || __HP_aCC
+# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
# else
diff --git a/include/gtest/internal/gtest-type-util.h.pump b/include/gtest/internal/gtest-type-util.h.pump
index 27f331d..8198e10 100644
--- a/include/gtest/internal/gtest-type-util.h.pump
+++ b/include/gtest/internal/gtest-type-util.h.pump
@@ -47,11 +47,11 @@ $var n = 50 $$ Maximum length of type lists we want to support.
// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
// libstdc++ (which is where cxxabi.h comes from).
-# ifdef __GLIBCXX__
+# if GTEST_HAS_CXXABI_H_
# include <cxxabi.h>
# elif defined(__HP_aCC)
# include <acxx_demangle.h>
-# endif // __GLIBCXX__
+# endif // GTEST_HASH_CXXABI_H_
namespace testing {
namespace internal {
@@ -64,20 +64,20 @@ String GetTypeName() {
# if GTEST_HAS_RTTI
const char* const name = typeid(T).name();
-# if defined(__GLIBCXX__) || defined(__HP_aCC)
+# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
int status = 0;
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
-# ifdef __GLIBCXX__
+# if GTEST_HAS_CXXABI_H_
using abi::__cxa_demangle;
-# endif // __GLIBCXX__
+# endif // GTEST_HAS_CXXABI_H_
char* const readable_name = __cxa_demangle(name, 0, 0, &status);
const String name_str(status == 0 ? readable_name : name);
free(readable_name);
return name_str;
# else
return name;
-# endif // __GLIBCXX__ || __HP_aCC
+# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
# else
diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py
index 4e897bd..6dd8db4 100755
--- a/test/gtest_test_utils.py
+++ b/test/gtest_test_utils.py
@@ -241,7 +241,7 @@ class Subprocess:
# Changes made by os.environ.clear are not inheritable by child
# processes until Python 2.6. To produce inheritable changes we have
# to delete environment items with the del statement.
- for key in dest:
+ for key in dest.keys():
del dest[key]
dest.update(src)