Skip to content

Commit f35f4c6

Browse files
author
vladlosev
committed
Fixes a user reported test break (modifying a dict while iterating).
git-svn-id: http://googletest.googlecode.com/svn/trunk@588 861a406c-534a-0410-8894-cb66d6ee9925
1 parent 8757774 commit f35f4c6

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

include/gtest/internal/gtest-port.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@
678678
# define GTEST_NO_INLINE_
679679
#endif
680680

681+
// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
682+
#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
683+
# define GTEST_HAS_CXXABI_H_ 1
684+
#else
685+
# define GTEST_HAS_CXXABI_H_ 0
686+
#endif
687+
681688
namespace testing {
682689

683690
class Message;

include/gtest/internal/gtest-type-util.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949

5050
// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
5151
// libstdc++ (which is where cxxabi.h comes from).
52-
# ifdef __GLIBCXX__
52+
# if GTEST_HAS_CXXABI_H_
5353
# include <cxxabi.h>
5454
# elif defined(__HP_aCC)
5555
# include <acxx_demangle.h>
56-
# endif // __GLIBCXX__
56+
# endif // GTEST_HASH_CXXABI_H_
5757

5858
namespace testing {
5959
namespace internal {
@@ -66,20 +66,20 @@ String GetTypeName() {
6666
# if GTEST_HAS_RTTI
6767

6868
const char* const name = typeid(T).name();
69-
# if defined(__GLIBCXX__) || defined(__HP_aCC)
69+
# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
7070
int status = 0;
7171
// gcc's implementation of typeid(T).name() mangles the type name,
7272
// so we have to demangle it.
73-
# ifdef __GLIBCXX__
73+
# if GTEST_HAS_CXXABI_H_
7474
using abi::__cxa_demangle;
75-
# endif // __GLIBCXX__
75+
# endif // GTEST_HAS_CXXABI_H_
7676
char* const readable_name = __cxa_demangle(name, 0, 0, &status);
7777
const String name_str(status == 0 ? readable_name : name);
7878
free(readable_name);
7979
return name_str;
8080
# else
8181
return name;
82-
# endif // __GLIBCXX__ || __HP_aCC
82+
# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
8383

8484
# else
8585

include/gtest/internal/gtest-type-util.h.pump

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ $var n = 50 $$ Maximum length of type lists we want to support.
4747

4848
// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
4949
// libstdc++ (which is where cxxabi.h comes from).
50-
# ifdef __GLIBCXX__
50+
# if GTEST_HAS_CXXABI_H_
5151
# include <cxxabi.h>
5252
# elif defined(__HP_aCC)
5353
# include <acxx_demangle.h>
54-
# endif // __GLIBCXX__
54+
# endif // GTEST_HASH_CXXABI_H_
5555

5656
namespace testing {
5757
namespace internal {
@@ -64,20 +64,20 @@ String GetTypeName() {
6464
# if GTEST_HAS_RTTI
6565

6666
const char* const name = typeid(T).name();
67-
# if defined(__GLIBCXX__) || defined(__HP_aCC)
67+
# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
6868
int status = 0;
6969
// gcc's implementation of typeid(T).name() mangles the type name,
7070
// so we have to demangle it.
71-
# ifdef __GLIBCXX__
71+
# if GTEST_HAS_CXXABI_H_
7272
using abi::__cxa_demangle;
73-
# endif // __GLIBCXX__
73+
# endif // GTEST_HAS_CXXABI_H_
7474
char* const readable_name = __cxa_demangle(name, 0, 0, &status);
7575
const String name_str(status == 0 ? readable_name : name);
7676
free(readable_name);
7777
return name_str;
7878
# else
7979
return name;
80-
# endif // __GLIBCXX__ || __HP_aCC
80+
# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
8181

8282
# else
8383

test/gtest_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def _ReplaceEnvDict(dest, src):
241241
# Changes made by os.environ.clear are not inheritable by child
242242
# processes until Python 2.6. To produce inheritable changes we have
243243
# to delete environment items with the del statement.
244-
for key in dest:
244+
for key in dest.keys():
245245
del dest[key]
246246
dest.update(src)
247247

0 commit comments

Comments
 (0)