aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-01-04 21:49:27 -0500
committerGennadiy Civil <misterg@google.com>2018-01-04 21:49:27 -0500
commit19b5774ccf6c20d7a8d076de9e791629e72ffc0d (patch)
treeb3bdaa855629accb476e87d371201bb6adc5be6f
parentbe6ee26a9b5b814c3e173c6e5e97c385fbdc1fb0 (diff)
downloadgoogletest-19b5774ccf6c20d7a8d076de9e791629e72ffc0d.tar.gz
googletest-19b5774ccf6c20d7a8d076de9e791629e72ffc0d.tar.bz2
googletest-19b5774ccf6c20d7a8d076de9e791629e72ffc0d.zip
code cleanup in preparation for merges, cl 180857299
-rw-r--r--googletest/test/gtest-death-test_test.cc4
-rw-r--r--googletest/test/gtest-filepath_test.cc6
-rw-r--r--googletest/test/gtest-options_test.cc1
-rw-r--r--googletest/test/gtest-param-test2_test.cc1
-rw-r--r--googletest/test/gtest-port_test.cc4
-rw-r--r--googletest/test/gtest_break_on_failure_unittest_.cc3
-rw-r--r--googletest/test/gtest_output_test_.cc10
-rw-r--r--googletest/test/gtest_repeat_test.cc1
-rw-r--r--googletest/test/gtest_stress_test.cc1
-rw-r--r--googletest/test/gtest_xml_outfile1_test_.cc1
-rw-r--r--googletest/test/gtest_xml_outfile2_test_.cc1
-rw-r--r--googletest/test/gtest_xml_output_unittest_.cc2
12 files changed, 19 insertions, 16 deletions
diff --git a/googletest/test/gtest-death-test_test.cc b/googletest/test/gtest-death-test_test.cc
index 0e1e87b7..b7846b2c 100644
--- a/googletest/test/gtest-death-test_test.cc
+++ b/googletest/test/gtest-death-test_test.cc
@@ -305,14 +305,14 @@ void DieWithEmbeddedNul() {
}
# if GTEST_USES_PCRE
+
// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
// message has a NUL character in it.
TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
- // TODO(wan@google.com): <regex.h> doesn't support matching strings
- // with embedded NUL characters - find a way to workaround it.
EXPECT_DEATH(DieWithEmbeddedNul(), "my null world");
ASSERT_DEATH(DieWithEmbeddedNul(), "my null world");
}
+
# endif // GTEST_USES_PCRE
// Tests that death test macros expand to code which interacts well with switch
diff --git a/googletest/test/gtest-filepath_test.cc b/googletest/test/gtest-filepath_test.cc
index cc4883bc..29cea3d1 100644
--- a/googletest/test/gtest-filepath_test.cc
+++ b/googletest/test/gtest-filepath_test.cc
@@ -27,16 +27,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: keith.ray@gmail.com (Keith Ray)
//
// Google Test filepath utilities
//
// This file tests classes and functions used internally by
// Google Test. They are subject to change without notice.
//
-// This file is #included from gtest_unittest.cc, to avoid changing
-// build or make-files for some existing Google Test clients. Do not
-// #include this file anywhere else!
+// This file is #included from gtest-internal.h.
+// Do not #include this file anywhere else!
#include "gtest/internal/gtest-filepath.h"
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest-options_test.cc b/googletest/test/gtest-options_test.cc
index 70f3ce94..25c9f394 100644
--- a/googletest/test/gtest-options_test.cc
+++ b/googletest/test/gtest-options_test.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: keith.ray@gmail.com (Keith Ray)
//
// Google Test UnitTestOptions tests
//
diff --git a/googletest/test/gtest-param-test2_test.cc b/googletest/test/gtest-param-test2_test.cc
index e7afdc32..0c09b27e 100644
--- a/googletest/test/gtest-param-test2_test.cc
+++ b/googletest/test/gtest-param-test2_test.cc
@@ -59,3 +59,4 @@ INSTANTIATE_TEST_CASE_P(MultiplesOf33,
INSTANTIATE_TEST_CASE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest,
Values(42*3, 42*4, 42*5));
+
diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/gtest-port_test.cc
index 2c59edc3..4ed4afca 100644
--- a/googletest/test/gtest-port_test.cc
+++ b/googletest/test/gtest-port_test.cc
@@ -67,8 +67,8 @@ TEST(IsXDigitTest, WorksForNarrowAscii) {
}
TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) {
- EXPECT_FALSE(IsXDigit('\x80'));
- EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80')));
+ EXPECT_FALSE(IsXDigit(static_cast<char>(0x80)));
+ EXPECT_FALSE(IsXDigit(static_cast<char>('0' | 0x80)));
}
TEST(IsXDigitTest, WorksForWideAscii) {
diff --git a/googletest/test/gtest_break_on_failure_unittest_.cc b/googletest/test/gtest_break_on_failure_unittest_.cc
index dd07478c..1231ec28 100644
--- a/googletest/test/gtest_break_on_failure_unittest_.cc
+++ b/googletest/test/gtest_break_on_failure_unittest_.cc
@@ -80,8 +80,7 @@ int main(int argc, char **argv) {
SetUnhandledExceptionFilter(ExitWithExceptionCode);
# endif
-#endif
-
+#endif // GTEST_OS_WINDOWS
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
diff --git a/googletest/test/gtest_output_test_.cc b/googletest/test/gtest_output_test_.cc
index 6aaba977..c7ccc21c 100644
--- a/googletest/test/gtest_output_test_.cc
+++ b/googletest/test/gtest_output_test_.cc
@@ -168,6 +168,16 @@ void SubWithTrace(int n) {
SubWithoutTrace(n);
}
+TEST(SCOPED_TRACETest, AcceptedValues) {
+ SCOPED_TRACE("literal string");
+ SCOPED_TRACE(std::string("std::string"));
+ SCOPED_TRACE(1337); // streamable type
+ const char* null_value = NULL;
+ SCOPED_TRACE(null_value);
+
+ ADD_FAILURE() << "Just checking that all these values work fine.";
+}
+
// Tests that SCOPED_TRACE() obeys lexical scopes.
TEST(SCOPED_TRACETest, ObeysScopes) {
printf("(expected to fail)\n");
diff --git a/googletest/test/gtest_repeat_test.cc b/googletest/test/gtest_repeat_test.cc
index dcaadd72..b9e65e4c 100644
--- a/googletest/test/gtest_repeat_test.cc
+++ b/googletest/test/gtest_repeat_test.cc
@@ -210,6 +210,7 @@ void TestRepeatWithFilterForFailedTests(int repeat) {
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
+
testing::AddGlobalTestEnvironment(new MyEnvironment);
TestRepeatUnspecified();
diff --git a/googletest/test/gtest_stress_test.cc b/googletest/test/gtest_stress_test.cc
index 59a1b623..cac405f8 100644
--- a/googletest/test/gtest_stress_test.cc
+++ b/googletest/test/gtest_stress_test.cc
@@ -34,7 +34,6 @@
#include "gtest/gtest.h"
-#include <iostream>
#include <vector>
#include "src/gtest-internal-inl.h"
diff --git a/googletest/test/gtest_xml_outfile1_test_.cc b/googletest/test/gtest_xml_outfile1_test_.cc
index 531ced49..e3d1dd1e 100644
--- a/googletest/test/gtest_xml_outfile1_test_.cc
+++ b/googletest/test/gtest_xml_outfile1_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Author: keith.ray@gmail.com (Keith Ray)
//
// gtest_xml_outfile1_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_outfile2_test_.cc b/googletest/test/gtest_xml_outfile2_test_.cc
index 7b400b27..55eb8f39 100644
--- a/googletest/test/gtest_xml_outfile2_test_.cc
+++ b/googletest/test/gtest_xml_outfile2_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Author: keith.ray@gmail.com (Keith Ray)
//
// gtest_xml_outfile2_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_output_unittest_.cc b/googletest/test/gtest_xml_output_unittest_.cc
index 48b8771b..2ee88380 100644
--- a/googletest/test/gtest_xml_output_unittest_.cc
+++ b/googletest/test/gtest_xml_output_unittest_.cc
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Author: eefacm@gmail.com (Sean Mcafee)
-
// Unit test for Google Test XML output.
//
// A user can specify XML output in a Google Test program to run via