OLD | NEW |
1 // Copyright 2007, Google Inc. | 1 // Copyright 2007, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) { | 57 for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) { |
58 // We don't care about the current locale as the input is | 58 // We don't care about the current locale as the input is |
59 // guaranteed to be a valid C++ identifier name. | 59 // guaranteed to be a valid C++ identifier name. |
60 const bool starts_new_word = isupper(*p) || | 60 const bool starts_new_word = isupper(*p) || |
61 (!isalpha(prev_char) && islower(*p)) || | 61 (!isalpha(prev_char) && islower(*p)) || |
62 (!isdigit(prev_char) && isdigit(*p)); | 62 (!isdigit(prev_char) && isdigit(*p)); |
63 | 63 |
64 if (isalnum(*p)) { | 64 if (isalnum(*p)) { |
65 if (starts_new_word && result != "") | 65 if (starts_new_word && result != "") |
66 result += ' '; | 66 result += ' '; |
67 result += tolower(*p); | 67 result += static_cast<char>(tolower(*p)); |
68 } | 68 } |
69 } | 69 } |
70 return result; | 70 return result; |
71 } | 71 } |
72 | 72 |
73 // This class reports Google Mock failures as Google Test failures. A | 73 // This class reports Google Mock failures as Google Test failures. A |
74 // user can define another class in a similar fashion if he intends to | 74 // user can define another class in a similar fashion if he intends to |
75 // use Google Mock with a testing framework other than Google Test. | 75 // use Google Mock with a testing framework other than Google Test. |
76 class GoogleTestFailureReporter : public FailureReporterInterface { | 76 class GoogleTestFailureReporter : public FailureReporterInterface { |
77 public: | 77 public: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 std::cout << "Stack trace:\n" | 165 std::cout << "Stack trace:\n" |
166 << ::testing::internal::GetCurrentOsStackTraceExceptTop( | 166 << ::testing::internal::GetCurrentOsStackTraceExceptTop( |
167 ::testing::UnitTest::GetInstance(), actual_to_skip); | 167 ::testing::UnitTest::GetInstance(), actual_to_skip); |
168 } | 168 } |
169 std::cout << ::std::flush; | 169 std::cout << ::std::flush; |
170 } | 170 } |
171 | 171 |
172 } // namespace internal | 172 } // namespace internal |
173 } // namespace testing | 173 } // namespace testing |
OLD | NEW |