Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
f7af24c7
Commit
f7af24c7
authored
Sep 24, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifies gmock code using gtest's OS-indicating macros.
parent
b0d1c08f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
gmock-actions.h
include/gmock/gmock-actions.h
+4
-4
gmock-printers.cc
src/gmock-printers.cc
+2
-2
gmock_main.cc
src/gmock_main.cc
+2
-2
gmock-actions_test.cc
test/gmock-actions_test.cc
+4
-4
gmock_link_test.h
test/gmock_link_test.h
+7
-7
No files found.
include/gmock/gmock-actions.h
View file @
f7af24c7
...
@@ -606,7 +606,7 @@ class AssignAction {
...
@@ -606,7 +606,7 @@ class AssignAction {
const
T2
value_
;
const
T2
value_
;
};
};
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
// Implements the SetErrnoAndReturn action to simulate return from
// Implements the SetErrnoAndReturn action to simulate return from
// various system calls and libc functions.
// various system calls and libc functions.
...
@@ -626,7 +626,7 @@ class SetErrnoAndReturnAction {
...
@@ -626,7 +626,7 @@ class SetErrnoAndReturnAction {
const
T
result_
;
const
T
result_
;
};
};
#endif //
_WIN32_WC
E
#endif //
!GTEST_OS_WINDOWS_MOBIL
E
// Implements the SetArgumentPointee<N>(x) action for any function
// Implements the SetArgumentPointee<N>(x) action for any function
// whose N-th argument (0-based) is a pointer to x's type. The
// whose N-th argument (0-based) is a pointer to x's type. The
...
@@ -912,7 +912,7 @@ PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
...
@@ -912,7 +912,7 @@ PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
return
MakePolymorphicAction
(
internal
::
AssignAction
<
T1
,
T2
>
(
ptr
,
val
));
return
MakePolymorphicAction
(
internal
::
AssignAction
<
T1
,
T2
>
(
ptr
,
val
));
}
}
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
// Creates an action that sets errno and returns the appropriate error.
// Creates an action that sets errno and returns the appropriate error.
template
<
typename
T
>
template
<
typename
T
>
...
@@ -922,7 +922,7 @@ SetErrnoAndReturn(int errval, T result) {
...
@@ -922,7 +922,7 @@ SetErrnoAndReturn(int errval, T result) {
internal
::
SetErrnoAndReturnAction
<
T
>
(
errval
,
result
));
internal
::
SetErrnoAndReturnAction
<
T
>
(
errval
,
result
));
}
}
#endif //
_WIN32_WC
E
#endif //
!GTEST_OS_WINDOWS_MOBIL
E
// Various overloads for InvokeWithoutArgs().
// Various overloads for InvokeWithoutArgs().
...
...
src/gmock-printers.cc
View file @
f7af24c7
...
@@ -55,13 +55,13 @@ namespace {
...
@@ -55,13 +55,13 @@ namespace {
using
::
std
::
ostream
;
using
::
std
::
ostream
;
#if
def _WIN32_WC
E // Windows CE does not define _snprintf_s.
#if
GTEST_OS_WINDOWS_MOBIL
E // Windows CE does not define _snprintf_s.
#define snprintf _snprintf
#define snprintf _snprintf
#elif _MSC_VER >= 1400 // VC 8.0 and later deprecate snprintf and _snprintf.
#elif _MSC_VER >= 1400 // VC 8.0 and later deprecate snprintf and _snprintf.
#define snprintf _snprintf_s
#define snprintf _snprintf_s
#elif _MSC_VER
#elif _MSC_VER
#define snprintf _snprintf
#define snprintf _snprintf
#endif
#endif
// GTEST_OS_WINDOWS_MOBILE
// Prints a segment of bytes in the given object.
// Prints a segment of bytes in the given object.
void
PrintByteSegmentInObjectTo
(
const
unsigned
char
*
obj_bytes
,
size_t
start
,
void
PrintByteSegmentInObjectTo
(
const
unsigned
char
*
obj_bytes
,
size_t
start
,
...
...
src/gmock_main.cc
View file @
f7af24c7
...
@@ -38,13 +38,13 @@
...
@@ -38,13 +38,13 @@
// is enabled. For this reason instead of _tmain, main function is used on
// is enabled. For this reason instead of _tmain, main function is used on
// Windows. See the following link to track the current status of this bug:
// Windows. See the following link to track the current status of this bug:
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
#if
def _WIN32_WC
E
#if
GTEST_OS_WINDOWS_MOBIL
E
#include <tchar.h> // NOLINT
#include <tchar.h> // NOLINT
int
_tmain
(
int
argc
,
TCHAR
**
argv
)
{
int
_tmain
(
int
argc
,
TCHAR
**
argv
)
{
#else
#else
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
#endif //
_WIN32_WC
E
#endif //
GTEST_OS_WINDOWS_MOBIL
E
std
::
cout
<<
"Running main() from gmock_main.cc
\n
"
;
std
::
cout
<<
"Running main() from gmock_main.cc
\n
"
;
// Since Google Mock depends on Google Test, InitGoogleMock() is
// Since Google Mock depends on Google Test, InitGoogleMock() is
// also responsible for initializing Google Test. Therefore there's
// also responsible for initializing Google Test. Therefore there's
...
...
test/gmock-actions_test.cc
View file @
f7af24c7
...
@@ -70,9 +70,9 @@ using testing::ReturnNull;
...
@@ -70,9 +70,9 @@ using testing::ReturnNull;
using
testing
::
ReturnRef
;
using
testing
::
ReturnRef
;
using
testing
::
SetArgumentPointee
;
using
testing
::
SetArgumentPointee
;
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
using
testing
::
SetErrnoAndReturn
;
using
testing
::
SetErrnoAndReturn
;
#endif
// _WIN32_WCE
#endif
#if GMOCK_HAS_PROTOBUF_
#if GMOCK_HAS_PROTOBUF_
using
testing
::
internal
::
TestMessage
;
using
testing
::
internal
::
TestMessage
;
...
@@ -911,7 +911,7 @@ TEST(AssignTest, CompatibleTypes) {
...
@@ -911,7 +911,7 @@ TEST(AssignTest, CompatibleTypes) {
EXPECT_DOUBLE_EQ
(
5
,
x
);
EXPECT_DOUBLE_EQ
(
5
,
x
);
}
}
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
class
SetErrnoAndReturnTest
:
public
testing
::
Test
{
class
SetErrnoAndReturnTest
:
public
testing
::
Test
{
protected
:
protected
:
...
@@ -938,7 +938,7 @@ TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
...
@@ -938,7 +938,7 @@ TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
EXPECT_EQ
(
EINVAL
,
errno
);
EXPECT_EQ
(
EINVAL
,
errno
);
}
}
#endif //
_WIN32_WC
E
#endif //
!GTEST_OS_WINDOWS_MOBIL
E
// Tests ByRef().
// Tests ByRef().
...
...
test/gmock_link_test.h
View file @
f7af24c7
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
#include <gmock/gmock.h>
#include <gmock/gmock.h>
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
#include <errno.h>
#include <errno.h>
#endif
#endif
...
@@ -176,18 +176,18 @@ using testing::WithArg;
...
@@ -176,18 +176,18 @@ using testing::WithArg;
using
testing
::
WithArgs
;
using
testing
::
WithArgs
;
using
testing
::
WithoutArgs
;
using
testing
::
WithoutArgs
;
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
using
testing
::
SetErrnoAndReturn
;
using
testing
::
SetErrnoAndReturn
;
#endif
// _WIN32_WCE
#endif
#if GTEST_HAS_EXCEPTIONS
#if GTEST_HAS_EXCEPTIONS
using
testing
::
Throw
;
using
testing
::
Throw
;
#endif
// GTEST_HAS_EXCEPTIONS
#endif
#if GMOCK_HAS_REGEX
#if GMOCK_HAS_REGEX
using
testing
::
ContainsRegex
;
using
testing
::
ContainsRegex
;
using
testing
::
MatchesRegex
;
using
testing
::
MatchesRegex
;
#endif
// GMOCK_HAS_REGEX
#endif
class
Interface
{
class
Interface
{
public
:
public
:
...
@@ -297,7 +297,7 @@ TEST(LinkTest, TestSetArrayArgument) {
...
@@ -297,7 +297,7 @@ TEST(LinkTest, TestSetArrayArgument) {
mock
.
VoidFromString
(
&
ch
);
mock
.
VoidFromString
(
&
ch
);
}
}
#if
ndef _WIN32_WC
E
#if
!GTEST_OS_WINDOWS_MOBIL
E
// Tests the linkage of the SetErrnoAndReturn action.
// Tests the linkage of the SetErrnoAndReturn action.
TEST
(
LinkTest
,
TestSetErrnoAndReturn
)
{
TEST
(
LinkTest
,
TestSetErrnoAndReturn
)
{
...
@@ -309,7 +309,7 @@ TEST(LinkTest, TestSetErrnoAndReturn) {
...
@@ -309,7 +309,7 @@ TEST(LinkTest, TestSetErrnoAndReturn) {
errno
=
saved_errno
;
errno
=
saved_errno
;
}
}
#endif //
_WIN32_WC
E
#endif //
!GTEST_OS_WINDOWS_MOBIL
E
// Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
// Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
TEST
(
LinkTest
,
TestInvoke
)
{
TEST
(
LinkTest
,
TestInvoke
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment