|
|
|||
File indexing completed on 2026-11-19 10:45:46
0001 // Copyright 2006, Google Inc. 0002 // All rights reserved. 0003 // 0004 // Redistribution and use in source and binary forms, with or without 0005 // modification, are permitted provided that the following conditions are 0006 // met: 0007 // 0008 // * Redistributions of source code must retain the above copyright 0009 // notice, this list of conditions and the following disclaimer. 0010 // * Redistributions in binary form must reproduce the above 0011 // copyright notice, this list of conditions and the following disclaimer 0012 // in the documentation and/or other materials provided with the 0013 // distribution. 0014 // * Neither the name of Google Inc. nor the names of its 0015 // contributors may be used to endorse or promote products derived from 0016 // this software without specific prior written permission. 0017 // 0018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 0019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 0020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 0021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 0022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 0023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 0024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 0025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 0026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 0027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 0028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0029 0030 // Google C++ Testing and Mocking Framework definitions useful in production 0031 // code. 0032 0033 #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ 0034 #define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ 0035 0036 // When you need to test the private or protected members of a class, 0037 // use the FRIEND_TEST macro to declare your tests as friends of the 0038 // class. For example: 0039 // 0040 // class MyClass { 0041 // private: 0042 // void PrivateMethod(); 0043 // FRIEND_TEST(MyClassTest, PrivateMethodWorks); 0044 // }; 0045 // 0046 // class MyClassTest : public testing::Test { 0047 // // ... 0048 // }; 0049 // 0050 // TEST_F(MyClassTest, PrivateMethodWorks) { 0051 // // Can call MyClass::PrivateMethod() here. 0052 // } 0053 // 0054 // Note: The test class must be in the same namespace as the class being tested. 0055 // For example, putting MyClassTest in an anonymous namespace will not work. 0056 0057 #define FRIEND_TEST(test_case_name, test_name) \ 0058 friend class test_case_name##_##test_name##_Test 0059 0060 #endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|