Samples changes upstreaming

pull/1190/head
misterg 8 years ago
parent aa31cb67c2
commit 52a9c14c48
  1. 6
      googletest/samples/sample10_unittest.cc
  2. 6
      googletest/samples/sample1_unittest.cc
  3. 3
      googletest/samples/sample3_unittest.cc
  4. 2
      googletest/samples/sample7_unittest.cc
  5. 2
      googletest/samples/sample8_unittest.cc
  6. 8
      googletest/samples/sample9_unittest.cc

@ -34,8 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "gtest/gtest.h"
namespace {
#include "third_party/gtest/include/gtest/gtest.h"
using ::testing::EmptyTestEventListener;
using ::testing::InitGoogleTest;
using ::testing::Test;
@ -46,7 +45,6 @@ using ::testing::TestPartResult;
using ::testing::UnitTest;
namespace {
// We will track memory used by this class.
class Water {
public:
@ -106,7 +104,6 @@ TEST(ListenersTest, LeaksWater) {
Water* water = new Water;
EXPECT_TRUE(water != NULL);
}
} // namespace
int main(int argc, char **argv) {
@ -142,4 +139,3 @@ int main(int argc, char **argv) {
}
return RUN_ALL_TESTS();
}
} // namespace

@ -72,6 +72,7 @@ namespace {
//
// </TechnicalDetails>
// Tests Factorial().
// Tests factorial of negative numbers.
@ -99,7 +100,9 @@ TEST(FactorialTest, Negative) {
}
// Tests factorial of 0.
TEST(FactorialTest, Zero) { EXPECT_EQ(1, Factorial(0)); }
TEST(FactorialTest, Zero) {
EXPECT_EQ(1, Factorial(0));
}
// Tests factorial of positive numbers.
TEST(FactorialTest, Positive) {
@ -109,6 +112,7 @@ TEST(FactorialTest, Positive) {
EXPECT_EQ(40320, Factorial(8));
}
// Tests IsPrime()
// Tests negative input.

@ -65,7 +65,7 @@
#include "sample3-inl.h"
#include "gtest/gtest.h"
namespace{
// To use a test fixture, derive a class from testing::Test.
class QueueTestSmpl3 : public testing::Test {
protected: // You should make the members protected s.t. they can be
@ -149,3 +149,4 @@ TEST_F(QueueTestSmpl3, Map) {
MapTester(&q1_);
MapTester(&q2_);
}
} // namespace

@ -127,4 +127,4 @@ INSTANTIATE_TEST_CASE_P(OnTheFlyAndPreCalculated, PrimeTableTestSmpl7,
TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
#endif // GTEST_HAS_PARAM_TEST
}
} // namespace

@ -171,4 +171,4 @@ INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
TEST(DummyTest, CombineIsNotSupportedOnThisPlatform) {}
#endif // GTEST_HAS_COMBINE
}
} // namespace

@ -34,8 +34,8 @@
#include <stdio.h>
#include "gtest/gtest.h"
namespace {
#include "third_party/gtest/include/gtest/gtest.h"
using ::testing::EmptyTestEventListener;
using ::testing::InitGoogleTest;
using ::testing::Test;
@ -44,9 +44,7 @@ using ::testing::TestEventListeners;
using ::testing::TestInfo;
using ::testing::TestPartResult;
using ::testing::UnitTest;
namespace {
// Provides alternative output mode which produces minimal amount of
// information about tests.
class TersePrinter : public EmptyTestEventListener {
@ -102,7 +100,6 @@ TEST(CustomOutputTest, Fails) {
EXPECT_EQ(1, 2)
<< "This test fails in order to demonstrate alternative failure messages";
}
} // namespace
int main(int argc, char **argv) {
@ -158,4 +155,3 @@ int main(int argc, char **argv) {
return ret_val;
}
} // namespace
Loading…
Cancel
Save