Path: blob/master/dep/googletest/include/gtest/gtest_prod.h
4806 views
// Copyright 2006, Google Inc.1// All rights reserved.2//3// Redistribution and use in source and binary forms, with or without4// modification, are permitted provided that the following conditions are5// met:6//7// * Redistributions of source code must retain the above copyright8// notice, this list of conditions and the following disclaimer.9// * Redistributions in binary form must reproduce the above10// copyright notice, this list of conditions and the following disclaimer11// in the documentation and/or other materials provided with the12// distribution.13// * Neither the name of Google Inc. nor the names of its14// contributors may be used to endorse or promote products derived from15// this software without specific prior written permission.16//17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT19// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR20// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT21// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,22// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT23// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,24// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT26// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE27// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2829// Google C++ Testing and Mocking Framework definitions useful in production30// code.3132#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_33#define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_3435// When you need to test the private or protected members of a class,36// use the FRIEND_TEST macro to declare your tests as friends of the37// class. For example:38//39// class MyClass {40// private:41// void PrivateMethod();42// FRIEND_TEST(MyClassTest, PrivateMethodWorks);43// };44//45// class MyClassTest : public testing::Test {46// // ...47// };48//49// TEST_F(MyClassTest, PrivateMethodWorks) {50// // Can call MyClass::PrivateMethod() here.51// }52//53// Note: The test class must be in the same namespace as the class being tested.54// For example, putting MyClassTest in an anonymous namespace will not work.5556#define FRIEND_TEST(test_case_name, test_name) \57friend class test_case_name##_##test_name##_Test5859#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_606162