OLD | NEW |
1 // Copyright 2008 Google Inc. | 1 // Copyright 2008 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 26 matching lines...) Expand all Loading... |
37 #if GTEST_HAS_TYPED_TEST_P | 37 #if GTEST_HAS_TYPED_TEST_P |
38 | 38 |
39 using testing::Test; | 39 using testing::Test; |
40 | 40 |
41 // For testing that the same type-parameterized test case can be | 41 // For testing that the same type-parameterized test case can be |
42 // instantiated in different translation units linked together. | 42 // instantiated in different translation units linked together. |
43 // ContainerTest will be instantiated in both gtest-typed-test_test.cc | 43 // ContainerTest will be instantiated in both gtest-typed-test_test.cc |
44 // and gtest-typed-test2_test.cc. | 44 // and gtest-typed-test2_test.cc. |
45 | 45 |
46 template <typename T> | 46 template <typename T> |
47 class ContainerTest : public Test { | 47 class ContainerTest : public Test {}; |
48 }; | |
49 | 48 |
50 TYPED_TEST_CASE_P(ContainerTest); | 49 TYPED_TEST_CASE_P(ContainerTest); |
51 | 50 |
52 TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) { | 51 TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) { TypeParam container; } |
53 TypeParam container; | |
54 } | |
55 | 52 |
56 TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { | 53 TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { |
57 TypeParam container; | 54 TypeParam container; |
58 EXPECT_EQ(0U, container.size()); | 55 EXPECT_EQ(0U, container.size()); |
59 } | 56 } |
60 | 57 |
61 REGISTER_TYPED_TEST_CASE_P(ContainerTest, | 58 REGISTER_TYPED_TEST_CASE_P(ContainerTest, CanBeDefaultConstructed, |
62 CanBeDefaultConstructed, InitialSizeIsZero); | 59 InitialSizeIsZero); |
63 | 60 |
64 #endif // GTEST_HAS_TYPED_TEST_P | 61 #endif // GTEST_HAS_TYPED_TEST_P |
65 | 62 |
66 #endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ | 63 #endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ |
OLD | NEW |