gtest_filter_unittest_.cc
Go to the documentation of this file.
00001 // Copyright 2005, Google Inc.
00002 // All rights reserved.
00003 //
00004 // Redistribution and use in source and binary forms, with or without
00005 // modification, are permitted provided that the following conditions are
00006 // met:
00007 //
00008 //     * Redistributions of source code must retain the above copyright
00009 // notice, this list of conditions and the following disclaimer.
00010 //     * Redistributions in binary form must reproduce the above
00011 // copyright notice, this list of conditions and the following disclaimer
00012 // in the documentation and/or other materials provided with the
00013 // distribution.
00014 //     * Neither the name of Google Inc. nor the names of its
00015 // contributors may be used to endorse or promote products derived from
00016 // this software without specific prior written permission.
00017 //
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // Author: wan@google.com (Zhanyong Wan)
00031 
00032 // Unit test for Google Test test filters.
00033 //
00034 // A user can specify which test(s) in a Google Test program to run via
00035 // either the GTEST_FILTER environment variable or the --gtest_filter
00036 // flag.  This is used for testing such functionality.
00037 //
00038 // The program will be invoked from a Python unit test.  Don't run it
00039 // directly.
00040 
00041 #include "gtest/gtest.h"
00042 
00043 namespace {
00044 
00045 // Test case FooTest.
00046 
00047 class FooTest : public testing::Test {
00048 };
00049 
00050 TEST_F(FooTest, Abc) {
00051 }
00052 
00053 TEST_F(FooTest, Xyz) {
00054   FAIL() << "Expected failure.";
00055 }
00056 
00057 // Test case BarTest.
00058 
00059 TEST(BarTest, TestOne) {
00060 }
00061 
00062 TEST(BarTest, TestTwo) {
00063 }
00064 
00065 TEST(BarTest, TestThree) {
00066 }
00067 
00068 TEST(BarTest, DISABLED_TestFour) {
00069   FAIL() << "Expected failure.";
00070 }
00071 
00072 TEST(BarTest, DISABLED_TestFive) {
00073   FAIL() << "Expected failure.";
00074 }
00075 
00076 // Test case BazTest.
00077 
00078 TEST(BazTest, TestOne) {
00079   FAIL() << "Expected failure.";
00080 }
00081 
00082 TEST(BazTest, TestA) {
00083 }
00084 
00085 TEST(BazTest, TestB) {
00086 }
00087 
00088 TEST(BazTest, DISABLED_TestC) {
00089   FAIL() << "Expected failure.";
00090 }
00091 
00092 // Test case HasDeathTest
00093 
00094 TEST(HasDeathTest, Test1) {
00095   EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
00096 }
00097 
00098 // We need at least two death tests to make sure that the all death tests
00099 // aren't on the first shard.
00100 TEST(HasDeathTest, Test2) {
00101   EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
00102 }
00103 
00104 // Test case FoobarTest
00105 
00106 TEST(DISABLED_FoobarTest, Test1) {
00107   FAIL() << "Expected failure.";
00108 }
00109 
00110 TEST(DISABLED_FoobarTest, DISABLED_Test2) {
00111   FAIL() << "Expected failure.";
00112 }
00113 
00114 // Test case FoobarbazTest
00115 
00116 TEST(DISABLED_FoobarbazTest, TestA) {
00117   FAIL() << "Expected failure.";
00118 }
00119 
00120 #if GTEST_HAS_PARAM_TEST
00121 class ParamTest : public testing::TestWithParam<int> {
00122 };
00123 
00124 TEST_P(ParamTest, TestX) {
00125 }
00126 
00127 TEST_P(ParamTest, TestY) {
00128 }
00129 
00130 INSTANTIATE_TEST_CASE_P(SeqP, ParamTest, testing::Values(1, 2));
00131 INSTANTIATE_TEST_CASE_P(SeqQ, ParamTest, testing::Values(5, 6));
00132 #endif  // GTEST_HAS_PARAM_TEST
00133 
00134 }  // namespace
00135 
00136 int main(int argc, char **argv) {
00137   ::testing::InitGoogleTest(&argc, argv);
00138 
00139   return RUN_ALL_TESTS();
00140 }


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:55