Commit 6d089311 authored by Tanzinul Islam's avatar Tanzinul Islam
Browse files

Merge branch 'fix_death_test_child_mingw_wer_issue1116' of...

Merge branch 'fix_death_test_child_mingw_wer_issue1116' of https://github.com/tanzislam/googletest into fix_death_test_child_mingw_wer_issue1116
parents 555e6e79 a7a7f51d
...@@ -42,11 +42,7 @@ ...@@ -42,11 +42,7 @@
# include <string> # include <string>
# include <vector> # include <vector>
// To include gtest-internal-inl.h.
# define GTEST_IMPLEMENTATION_ 1
# include "src/gtest-internal-inl.h" // for UnitTestOptions # include "src/gtest-internal-inl.h" // for UnitTestOptions
# undef GTEST_IMPLEMENTATION_
# include "test/gtest-param-test_test.h" # include "test/gtest-param-test_test.h"
using ::std::vector; using ::std::vector;
...@@ -540,6 +536,51 @@ TEST(CombineTest, CombineWithMaxNumberOfParameters) { ...@@ -540,6 +536,51 @@ TEST(CombineTest, CombineWithMaxNumberOfParameters) {
VerifyGenerator(gen, expected_values); VerifyGenerator(gen, expected_values);
} }
#if GTEST_LANG_CXX11
class NonDefaultConstructAssignString {
public:
NonDefaultConstructAssignString(const std::string& s) : str_(s) {}
const std::string& str() const { return str_; }
private:
std::string str_;
// Not default constructible
NonDefaultConstructAssignString();
// Not assignable
void operator=(const NonDefaultConstructAssignString&);
};
TEST(CombineTest, NonDefaultConstructAssign) {
const ParamGenerator<tuple<int, NonDefaultConstructAssignString> > gen =
Combine(Values(0, 1), Values(NonDefaultConstructAssignString("A"),
NonDefaultConstructAssignString("B")));
ParamGenerator<tuple<int, NonDefaultConstructAssignString> >::iterator it =
gen.begin();
EXPECT_EQ(0, std::get<0>(*it));
EXPECT_EQ("A", std::get<1>(*it).str());
++it;
EXPECT_EQ(0, std::get<0>(*it));
EXPECT_EQ("B", std::get<1>(*it).str());
++it;
EXPECT_EQ(1, std::get<0>(*it));
EXPECT_EQ("A", std::get<1>(*it).str());
++it;
EXPECT_EQ(1, std::get<0>(*it));
EXPECT_EQ("B", std::get<1>(*it).str());
++it;
EXPECT_TRUE(it == gen.end());
}
#endif // GTEST_LANG_CXX11
# endif // GTEST_HAS_COMBINE # endif // GTEST_HAS_COMBINE
// Tests that an generator produces correct sequence after being // Tests that an generator produces correct sequence after being
...@@ -815,8 +856,8 @@ class CustomFunctorNamingTest : public TestWithParam<std::string> {}; ...@@ -815,8 +856,8 @@ class CustomFunctorNamingTest : public TestWithParam<std::string> {};
TEST_P(CustomFunctorNamingTest, CustomTestNames) {} TEST_P(CustomFunctorNamingTest, CustomTestNames) {}
struct CustomParamNameFunctor { struct CustomParamNameFunctor {
std::string operator()(const ::testing::TestParamInfo<std::string>& info) { std::string operator()(const ::testing::TestParamInfo<std::string>& inf) {
return info.param; return inf.param;
} }
}; };
...@@ -833,8 +874,8 @@ INSTANTIATE_TEST_CASE_P(AllAllowedCharacters, ...@@ -833,8 +874,8 @@ INSTANTIATE_TEST_CASE_P(AllAllowedCharacters,
CustomParamNameFunctor()); CustomParamNameFunctor());
inline std::string CustomParamNameFunction( inline std::string CustomParamNameFunction(
const ::testing::TestParamInfo<std::string>& info) { const ::testing::TestParamInfo<std::string>& inf) {
return info.param; return inf.param;
} }
class CustomFunctionNamingTest : public TestWithParam<std::string> {}; class CustomFunctionNamingTest : public TestWithParam<std::string> {};
...@@ -852,11 +893,10 @@ INSTANTIATE_TEST_CASE_P(CustomParamNameFunction, ...@@ -852,11 +893,10 @@ INSTANTIATE_TEST_CASE_P(CustomParamNameFunction,
class CustomLambdaNamingTest : public TestWithParam<std::string> {}; class CustomLambdaNamingTest : public TestWithParam<std::string> {};
TEST_P(CustomLambdaNamingTest, CustomTestNames) {} TEST_P(CustomLambdaNamingTest, CustomTestNames) {}
INSTANTIATE_TEST_CASE_P(CustomParamNameLambda, INSTANTIATE_TEST_CASE_P(CustomParamNameLambda, CustomLambdaNamingTest,
CustomLambdaNamingTest,
Values(std::string("LambdaName")), Values(std::string("LambdaName")),
[](const ::testing::TestParamInfo<std::string>& tpinfo) { [](const ::testing::TestParamInfo<std::string>& inf) {
return tpinfo.param; return inf.param;
}); });
#endif // GTEST_LANG_CXX11 #endif // GTEST_LANG_CXX11
...@@ -1023,6 +1063,7 @@ TEST_F(ParameterizedDeathTest, GetParamDiesFromTestF) { ...@@ -1023,6 +1063,7 @@ TEST_F(ParameterizedDeathTest, GetParamDiesFromTestF) {
INSTANTIATE_TEST_CASE_P(RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5)); INSTANTIATE_TEST_CASE_P(RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5));
int main(int argc, char **argv) { int main(int argc, char **argv) {
// Used in TestGenerationTest test case. // Used in TestGenerationTest test case.
AddGlobalTestEnvironment(TestGenerationTest::Environment::Instance()); AddGlobalTestEnvironment(TestGenerationTest::Environment::Instance());
......
...@@ -45,15 +45,7 @@ ...@@ -45,15 +45,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h" #include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using std::make_pair; using std::make_pair;
using std::pair; using std::pair;
...@@ -75,8 +67,8 @@ TEST(IsXDigitTest, WorksForNarrowAscii) { ...@@ -75,8 +67,8 @@ TEST(IsXDigitTest, WorksForNarrowAscii) {
} }
TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) { TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) {
EXPECT_FALSE(IsXDigit('\x80')); EXPECT_FALSE(IsXDigit(static_cast<char>(0x80)));
EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80'))); EXPECT_FALSE(IsXDigit(static_cast<char>('0' | 0x80)));
} }
TEST(IsXDigitTest, WorksForWideAscii) { TEST(IsXDigitTest, WorksForWideAscii) {
......
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <vector> #include <vector>
#include "test/gtest-typed-test_test.h" #include "gtest-typed-test_test.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P #if GTEST_HAS_TYPED_TEST_P
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
// //
// Author: wan@google.com (Zhanyong Wan) // Author: wan@google.com (Zhanyong Wan)
#include "test/gtest-typed-test_test.h" #include "gtest-typed-test_test.h"
#include <set> #include <set>
#include <vector> #include <vector>
......
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
// //
// Sometimes it's desirable to build most of Google Test's own tests // Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose. // by compiling a single file. This file serves this purpose.
#include "test/gtest-filepath_test.cc" #include "gtest-filepath_test.cc"
#include "test/gtest-linked_ptr_test.cc" #include "gtest-linked_ptr_test.cc"
#include "test/gtest-message_test.cc" #include "gtest-message_test.cc"
#include "test/gtest-options_test.cc" #include "gtest-options_test.cc"
#include "test/gtest-port_test.cc" #include "gtest-port_test.cc"
#include "test/gtest_pred_impl_unittest.cc" #include "gtest_pred_impl_unittest.cc"
#include "test/gtest_prod_test.cc" #include "gtest_prod_test.cc"
#include "test/gtest-test-part_test.cc" #include "gtest-test-part_test.cc"
#include "test/gtest-typed-test_test.cc" #include "gtest-typed-test_test.cc"
#include "test/gtest-typed-test2_test.cc" #include "gtest-typed-test2_test.cc"
#include "test/gtest_unittest.cc" #include "gtest_unittest.cc"
#include "test/production.cc" #include "production.cc"
This diff is collapsed.
...@@ -40,10 +40,8 @@ Google Test) with different environments and command line flags. ...@@ -40,10 +40,8 @@ Google Test) with different environments and command line flags.
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
import gtest_test_utils
import os import os
import sys import gtest_test_utils
# Constants. # Constants.
......
...@@ -80,8 +80,7 @@ int main(int argc, char **argv) { ...@@ -80,8 +80,7 @@ int main(int argc, char **argv) {
SetUnhandledExceptionFilter(ExitWithExceptionCode); SetUnhandledExceptionFilter(ExitWithExceptionCode);
# endif # endif
#endif #endif // GTEST_OS_WINDOWS
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
......
...@@ -37,8 +37,6 @@ Google Test) and verifies their output. ...@@ -37,8 +37,6 @@ Google Test) and verifies their output.
__author__ = 'vladl@google.com (Vlad Losev)' __author__ = 'vladl@google.com (Vlad Losev)'
import os
import gtest_test_utils import gtest_test_utils
# Constants. # Constants.
......
...@@ -36,8 +36,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)' ...@@ -36,8 +36,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import gtest_test_utils import gtest_test_utils
IS_WINDOWS = os.name == 'nt'
IS_WINDOWS = os.name = 'nt'
COLOR_ENV_VAR = 'GTEST_COLOR' COLOR_ENV_VAR = 'GTEST_COLOR'
COLOR_FLAG = 'gtest_color' COLOR_FLAG = 'gtest_color'
......
...@@ -36,15 +36,7 @@ ...@@ -36,15 +36,7 @@
#include <stdio.h> #include <stdio.h>
#include "gtest/gtest.h" #include "gtest/gtest.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h" #include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using testing::internal::ShouldUseColor; using testing::internal::ShouldUseColor;
......
...@@ -47,8 +47,8 @@ environ = os.environ.copy() ...@@ -47,8 +47,8 @@ environ = os.environ.copy()
def AssertEq(expected, actual): def AssertEq(expected, actual):
if expected != actual: if expected != actual:
print('Expected: %s' % (expected,)) print 'Expected: %s' % (expected,)
print(' Actual: %s' % (actual,)) print ' Actual: %s' % (actual,)
raise AssertionError raise AssertionError
......
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
#include <iostream> #include <iostream>
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h" #include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using ::std::cout; using ::std::cout;
......
...@@ -34,10 +34,7 @@ ...@@ -34,10 +34,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#define GTEST_IMPLEMENTATION_ 1 // Required for the next #include.
#include "src/gtest-internal-inl.h" #include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace testing { namespace testing {
GTEST_DECLARE_string_(filter); GTEST_DECLARE_string_(filter);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment