Indents preprocessor directives.

This commit is contained in:
zhanyong.wan
2011-02-24 07:29:13 +00:00
parent ed6c9277bb
commit 658ac0b71a
16 changed files with 62 additions and 55 deletions

View File

@@ -593,8 +593,8 @@ TEST(DoAllTest, TenActions) {
// is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4100)
# pragma warning(push)
# pragma warning(disable:4100)
#endif
// Tests the ACTION*() macro family.
@@ -1205,7 +1205,7 @@ TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
}
#ifdef _MSC_VER
#pragma warning(pop)
# pragma warning(pop)
#endif
} // namespace gmock_generated_actions_test

View File

@@ -44,14 +44,14 @@
// MSDN says the header file to be included for STDMETHOD is BaseTyps.h but
// we are getting compiler errors if we use basetyps.h, hence including
// objbase.h for definition of STDMETHOD.
#include <objbase.h>
# include <objbase.h>
#endif // GTEST_OS_WINDOWS
// There is a bug in MSVC (fixed in VS 2008) that prevents creating a
// mock for a function with const arguments, so we don't test such
// cases for MSVC versions older than 2008.
#if !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
#define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
# define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
#endif // !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
namespace testing {

View File

@@ -144,8 +144,8 @@ TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
// is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4100)
# pragma warning(push)
# pragma warning(disable:4100)
#endif
MATCHER(SumIsZero, "") {
@@ -1092,7 +1092,7 @@ TEST(ContainsTest, WorksForTwoDimensionalNativeArray) {
}
#ifdef _MSC_VER
#pragma warning(pop)
# pragma warning(pop)
#endif
} // namespace

View File

@@ -45,7 +45,7 @@
#include "gtest/gtest-spi.h"
#if GTEST_OS_CYGWIN
#include <sys/types.h> // For ssize_t. NOLINT
# include <sys/types.h> // For ssize_t. NOLINT
#endif
class ProtocolMessage;
@@ -416,18 +416,21 @@ TEST(LogTest, NoSkippingStackFrameInOptMode) {
CaptureStdout();
Log(WARNING, "Test log.\n", 100);
const String log = GetCapturedStdout();
#if defined(NDEBUG) && GTEST_GOOGLE3_MODE_
# if defined(NDEBUG) && GTEST_GOOGLE3_MODE_
// In opt mode, no stack frame should be skipped.
EXPECT_THAT(log, ContainsRegex("\nGMOCK WARNING:\n"
"Test log\\.\n"
"Stack trace:\n"
".+"));
#else
# else
// In dbg mode, the stack frames should be skipped.
EXPECT_STREQ("\nGMOCK WARNING:\n"
"Test log.\n"
"Stack trace:\n", log.c_str());
#endif
# endif
}
// Tests that all logs are printed when the value of the

View File

@@ -1717,14 +1717,14 @@ TEST(DeletingMockEarlyTest, Success2) {
// Suppresses warning on unreferenced formal parameter in MSVC with
// -W4.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4100)
# pragma warning(push)
# pragma warning(disable:4100)
#endif
ACTION_P(Delete, ptr) { delete ptr; }
#ifdef _MSC_VER
#pragma warning(pop)
# pragma warning(pop)
#endif
TEST(DeletingMockEarlyTest, CanDeleteSelfInActionReturningVoid) {
@@ -1890,7 +1890,9 @@ TEST(FunctionCallMessageTest, UninterestingCallGeneratesFyiWithStackTrace) {
const String output = GetCapturedStdout();
EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", output);
EXPECT_PRED_FORMAT2(IsSubstring, "Stack trace:", output);
#ifndef NDEBUG
# ifndef NDEBUG
// We check the stack trace content in dbg-mode only, as opt-mode
// may inline the call we are interested in seeing.
@@ -1904,7 +1906,8 @@ TEST(FunctionCallMessageTest, UninterestingCallGeneratesFyiWithStackTrace) {
c.NonVoidMethod();
const String output2 = GetCapturedStdout();
EXPECT_PRED_FORMAT2(IsSubstring, "NonVoidMethod(", output2);
#endif // NDEBUG
# endif // NDEBUG
}
// Tests that an uninteresting mock function call causes the function
@@ -1949,14 +1952,14 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
const string& function_name) {
if (should_print) {
EXPECT_THAT(output.c_str(), HasSubstr(expected_substring));
#ifndef NDEBUG
# ifndef NDEBUG
// We check the stack trace content in dbg-mode only, as opt-mode
// may inline the call we are interested in seeing.
EXPECT_THAT(output.c_str(), HasSubstr(function_name));
#else
# else
// Suppresses 'unused function parameter' warnings.
static_cast<void>(function_name);
#endif // NDEBUG
# endif // NDEBUG
} else {
EXPECT_STREQ("", output.c_str());
}

View File

@@ -117,7 +117,7 @@
#include "gmock/gmock.h"
#if !GTEST_OS_WINDOWS_MOBILE
#include <errno.h>
# include <errno.h>
#endif
#include "gmock/internal/gmock-port.h"
@@ -419,8 +419,8 @@ TEST(LinkTest, TestThrow) {
// is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4100)
# pragma warning(push)
# pragma warning(disable:4100)
#endif
// Tests the linkage of actions created using ACTION macro.
@@ -455,7 +455,7 @@ ACTION_P2(ReturnEqualsEitherOf, first, second) {
}
#ifdef _MSC_VER
#pragma warning(pop)
# pragma warning(pop)
#endif
TEST(LinkTest, TestActionP2Macro) {