Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
907ae9ed
"vscode:/vscode.git/clone" did not exist on "822a53417bd6e838d1e8f5ca73b83ccf5bd71314"
Unverified
Commit
907ae9ed
authored
Sep 25, 2018
by
Gennadiy Civil
Committed by
GitHub
Sep 25, 2018
Browse files
Merge branch 'master' into python3-tests
parents
a4f57cf4
75e83470
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
680 deletions
+65
-680
.travis.yml
.travis.yml
+2
-3
appveyor.yml
appveyor.yml
+1
-4
ci/test_format.sh
ci/test_format.sh
+0
-33
googlemock/include/gmock/gmock-generated-matchers.h
googlemock/include/gmock/gmock-generated-matchers.h
+0
-446
googlemock/include/gmock/gmock-generated-matchers.h.pump
googlemock/include/gmock/gmock-generated-matchers.h.pump
+0
-69
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+17
-17
googletest/include/gtest/internal/gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+39
-66
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+4
-40
googletest/xcode/Config/General.xcconfig
googletest/xcode/Config/General.xcconfig
+2
-2
No files found.
.travis.yml
View file @
907ae9ed
...
@@ -18,14 +18,14 @@ matrix:
...
@@ -18,14 +18,14 @@ matrix:
-
os
:
linux
-
os
:
linux
compiler
:
clang
compiler
:
clang
sudo
:
true
sudo
:
true
env
:
TEST_CLANG_FORMAT="yes"
install
:
./ci/install-linux.sh && ./ci/log-config.sh
install
:
./ci/install-linux.sh && ./ci/log-config.sh
script
:
./ci/test_format.sh &&
./ci/build-linux-bazel.sh
script
:
./ci/build-linux-bazel.sh
-
os
:
linux
-
os
:
linux
group
:
deprecated-2017Q4
group
:
deprecated-2017Q4
compiler
:
gcc
compiler
:
gcc
install
:
./ci/install-linux.sh && ./ci/log-config.sh
install
:
./ci/install-linux.sh && ./ci/log-config.sh
script
:
./ci/build-linux-autotools.sh
script
:
./ci/build-linux-autotools.sh
env
:
VERBOSE=1 CXXFLAGS=-std=c++11
-
os
:
linux
-
os
:
linux
group
:
deprecated-2017Q4
group
:
deprecated-2017Q4
compiler
:
gcc
compiler
:
gcc
...
@@ -66,7 +66,6 @@ addons:
...
@@ -66,7 +66,6 @@ addons:
packages
:
packages
:
-
g++-4.9
-
g++-4.9
-
clang-3.9
-
clang-3.9
-
clang-format-3.9
notifications
:
notifications
:
email
:
false
email
:
false
appveyor.yml
View file @
907ae9ed
...
@@ -20,10 +20,6 @@ environment:
...
@@ -20,10 +20,6 @@ environment:
-
compiler
:
msvc-14-seh
-
compiler
:
msvc-14-seh
generator
:
"
Visual
Studio
14
2015
Win64"
generator
:
"
Visual
Studio
14
2015
Win64"
-
compiler
:
gcc-5.3.0-posix
generator
:
"
MinGW
Makefiles"
cxx_path
:
'
C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin'
-
compiler
:
gcc-6.3.0-posix
-
compiler
:
gcc-6.3.0-posix
generator
:
"
MinGW
Makefiles"
generator
:
"
MinGW
Makefiles"
cxx_path
:
'
C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin'
cxx_path
:
'
C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin'
...
@@ -39,6 +35,7 @@ install:
...
@@ -39,6 +35,7 @@ install:
Write-Output "Compiler: $env:compiler"
Write-Output "Compiler: $env:compiler"
Write-Output "Generator: $env:generator"
Write-Output "Generator: $env:generator"
Write-Output "Env:Configuation: $env:configuration"
Write-Output "Env:Configuation: $env:configuration"
Write-Output "Env: $env"
if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
Write-Output "This is *NOT* a pull request build"
Write-Output "This is *NOT* a pull request build"
} else {
} else {
...
...
ci/test_format.sh
deleted
100755 → 0
View file @
a4f57cf4
#!/bin/bash
echo
"clang-format - checking Code Formatting..."
if
[[
"
${
TRAVIS_OS_NAME
}
"
==
"linux"
]]
&&
\
[[
"
${
TEST_CLANG_FORMAT
}
"
==
"yes"
]]
;
then
RETURN
=
0
CLANG_FORMAT
=
"clang-format-3.9"
which clang-format-3.9
if
[
!
-f
".clang-format"
]
;
then
echo
".clang-format file not found!"
exit
1
fi
FILES
=
`
git diff master
--name-only
|
grep
-E
"
\.
(cc|cpp|h)$"
`
for
FILE
in
$FILES
;
do
$CLANG_FORMAT
$FILE
| cmp
$FILE
>
/dev/null
if
[
$?
-ne
0
]
;
then
echo
"[!] Clang-Format Found INCORRECT FORMATTING. Please re-format and re-submit. The following file failed:
$FILE
"
>
&2
RETURN
=
1
fi
done
exit
$RETURN
fi
exit
0
googlemock/include/gmock/gmock-generated-matchers.h
View file @
907ae9ed
...
@@ -553,452 +553,6 @@ Args(const InnerMatcher& matcher) {
...
@@ -553,452 +553,6 @@ Args(const InnerMatcher& matcher) {
k9
,
k10
>
(
matcher
);
k9
,
k10
>
(
matcher
);
}
}
// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
// n elements, where the i-th element in the container must
// match the i-th argument in the list. Each argument of
// ElementsAre() can be either a value or a matcher. We support up to
// 10 arguments.
//
// The use of DecayArray in the implementation allows ElementsAre()
// to accept string literals, whose type is const char[N], but we
// want to treat them as const char*.
//
// NOTE: Since ElementsAre() cares about the order of the elements, it
// must not be used with containers whose elements's order is
// undefined (e.g. hash_map).
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<>
>
ElementsAre
()
{
typedef
::
testing
::
tuple
<>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
());
}
template
<
typename
T1
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
>
>
ElementsAre
(
const
T1
&
e1
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
));
}
template
<
typename
T1
,
typename
T2
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
,
typename
T9
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
,
const
T9
&
e9
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
,
e9
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
,
typename
T9
,
typename
T10
>
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
,
typename
internal
::
DecayArray
<
T10
>::
type
>
>
ElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
,
const
T9
&
e9
,
const
T10
&
e10
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
,
typename
internal
::
DecayArray
<
T10
>::
type
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
,
e9
,
e10
));
}
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
// that matches n elements in any order. We support up to n=10 arguments.
//
// If you have >10 elements, consider UnorderedElementsAreArray() or
// UnorderedPointwise() instead.
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<>
>
UnorderedElementsAre
()
{
typedef
::
testing
::
tuple
<>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
());
}
template
<
typename
T1
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
));
}
template
<
typename
T1
,
typename
T2
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
,
typename
T9
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
,
const
T9
&
e9
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
,
e9
));
}
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
,
typename
T9
,
typename
T10
>
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
,
typename
internal
::
DecayArray
<
T10
>::
type
>
>
UnorderedElementsAre
(
const
T1
&
e1
,
const
T2
&
e2
,
const
T3
&
e3
,
const
T4
&
e4
,
const
T5
&
e5
,
const
T6
&
e6
,
const
T7
&
e7
,
const
T8
&
e8
,
const
T9
&
e9
,
const
T10
&
e10
)
{
typedef
::
testing
::
tuple
<
typename
internal
::
DecayArray
<
T1
>::
type
,
typename
internal
::
DecayArray
<
T2
>::
type
,
typename
internal
::
DecayArray
<
T3
>::
type
,
typename
internal
::
DecayArray
<
T4
>::
type
,
typename
internal
::
DecayArray
<
T5
>::
type
,
typename
internal
::
DecayArray
<
T6
>::
type
,
typename
internal
::
DecayArray
<
T7
>::
type
,
typename
internal
::
DecayArray
<
T8
>::
type
,
typename
internal
::
DecayArray
<
T9
>::
type
,
typename
internal
::
DecayArray
<
T10
>::
type
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
e1
,
e2
,
e3
,
e4
,
e5
,
e6
,
e7
,
e8
,
e9
,
e10
));
}
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
...
...
googlemock/include/gmock/gmock-generated-matchers.h.pump
View file @
907ae9ed
...
@@ -263,75 +263,6 @@ Args(const InnerMatcher& matcher) {
...
@@ -263,75 +263,6 @@ Args(const InnerMatcher& matcher) {
}
}
]]
// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
// n elements, where the i-th element in the container must
// match the i-th argument in the list. Each argument of
// ElementsAre() can be either a value or a matcher. We support up to
// $n arguments.
//
// The use of DecayArray in the implementation allows ElementsAre()
// to accept string literals, whose type is const char[N], but we
// want to treat them as const char*.
//
// NOTE: Since ElementsAre() cares about the order of the elements, it
// must not be used with containers whose elements's order is
// undefined (e.g. hash_map).
$
range
i
0.
.
n
$
for
i
[[
$
range
j
1.
.
i
$
if
i
>
0
[[
template
<
$
for
j
,
[[
typename
T
$
j
]]>
]]
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
ElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
$
for
j
,
[[
e
$
j
]]));
}
]]
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
// that matches n elements in any order. We support up to n=$n arguments.
//
// If you have >$n elements, consider UnorderedElementsAreArray() or
// UnorderedPointwise() instead.
$
range
i
0.
.
n
$
for
i
[[
$
range
j
1.
.
i
$
if
i
>
0
[[
template
<
$
for
j
,
[[
typename
T
$
j
]]>
]]
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
UnorderedElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
$
for
j
,
[[
e
$
j
]]));
}
]]
]]
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
...
...
googlemock/include/gmock/gmock-matchers.h
View file @
907ae9ed
...
@@ -5170,23 +5170,6 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
...
@@ -5170,23 +5170,6 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
return
ss
.
str
();
return
ss
.
str
();
}
}
#if GTEST_LANG_CXX11
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template
<
typename
...
Args
>
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AllOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AnyOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
template
<
typename
...
Args
>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
ElementsAre
(
const
Args
&
...
matchers
)
{
ElementsAre
(
const
Args
&
...
matchers
)
{
...
@@ -5204,6 +5187,23 @@ UnorderedElementsAre(const Args&... matchers) {
...
@@ -5204,6 +5187,23 @@ UnorderedElementsAre(const Args&... matchers) {
make_tuple
(
matchers
...));
make_tuple
(
matchers
...));
}
}
#if GTEST_LANG_CXX11
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template
<
typename
...
Args
>
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AllOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AnyOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
#endif // GTEST_LANG_CXX11
#endif // GTEST_LANG_CXX11
// AllArgs(m) is a synonym of m. This is useful in
// AllArgs(m) is a synonym of m. This is useful in
...
...
googletest/include/gtest/internal/gtest-internal.h
View file @
907ae9ed
...
@@ -1189,18 +1189,6 @@ class NativeArray {
...
@@ -1189,18 +1189,6 @@ class NativeArray {
GTEST_DISALLOW_ASSIGN_
(
NativeArray
);
GTEST_DISALLOW_ASSIGN_
(
NativeArray
);
};
};
class
AdditionalMessage
{
public:
AdditionalMessage
(
const
char
*
message
)
:
msg
(
message
)
{}
void
set
(
const
std
::
string
&
message
)
{
msg
=
message
;
}
operator
bool
()
const
{
return
true
;
}
const
std
::
string
&
get
()
const
{
return
msg
;
}
private:
std
::
string
msg
;
};
}
// namespace internal
}
// namespace internal
}
// namespace testing
}
// namespace testing
...
@@ -1226,60 +1214,45 @@ class AdditionalMessage {
...
@@ -1226,60 +1214,45 @@ class AdditionalMessage {
#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
if (::testing::internal::AlwaysTrue()) { statement; }
if (::testing::internal::AlwaysTrue()) { statement; }
#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (::testing::internal::AdditionalMessage message = "") { \
if (::testing::internal::ConstCharPtr gtest_msg = "") { \
bool gtest_caught_expected = false; \
bool gtest_caught_expected = false; \
try { \
try { \
try { \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
} \
} catch (expected_exception const&) { \
catch (expected_exception const&) { \
gtest_caught_expected = true; \
gtest_caught_expected = true; \
throw; \
} \
} \
catch (...) { \
} catch (const std::exception& e) { \
gtest_msg.value = \
if (!gtest_caught_expected) { \
"Expected: " #statement " throws an exception of type " \
message.set( \
#expected_exception ".\n Actual: it throws a different type."; \
"it throws a different type " \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
"with message: " + \
} \
std::string(e.what())); \
if (!gtest_caught_expected) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
gtest_msg.value = \
} \
"Expected: " #statement " throws an exception of type " \
} catch (...) { \
#expected_exception ".\n Actual: it throws nothing."; \
if (!gtest_caught_expected) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
message.set("it throws a different type."); \
} \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
} else \
} \
GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
} \
fail(gtest_msg.value)
if (!gtest_caught_expected) { \
message.set("it throws nothing."); \
#define GTEST_TEST_NO_THROW_(statement, fail) \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
} \
if (::testing::internal::AlwaysTrue()) { \
} else \
try { \
GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__) \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
: fail(("Expected: " #statement \
} \
" throws an exception of type " #expected_exception \
catch (...) { \
".\n Actual: " + \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
message.get()) \
} \
.c_str())
} else \
GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
#define GTEST_TEST_NO_THROW_(statement, fail) \
fail("Expected: " #statement " doesn't throw an exception.\n" \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
" Actual: it throws.")
if (::testing::internal::AdditionalMessage message = ".") { \
try { \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
} catch (const std::exception& e) { \
message.set(std::string(": ") + e.what()); \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
} catch (...) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
} \
} else \
GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__) \
: fail(("Expected: " #statement " doesn't throw an exception.\n" \
" Actual: it throws" + \
message.get()) \
.c_str())
#define GTEST_TEST_ANY_THROW_(statement, fail) \
#define GTEST_TEST_ANY_THROW_(statement, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
...
...
googletest/test/gtest_unittest.cc
View file @
907ae9ed
...
@@ -3328,7 +3328,6 @@ TEST_F(SingleEvaluationTest, OtherCases) {
...
@@ -3328,7 +3328,6 @@ TEST_F(SingleEvaluationTest, OtherCases) {
void
ThrowAnInteger
()
{
void
ThrowAnInteger
()
{
throw
1
;
throw
1
;
}
}
void
ThrowAnException
(
const
char
*
what
)
{
throw
std
::
runtime_error
(
what
);
}
// Tests that assertion arguments are evaluated exactly once.
// Tests that assertion arguments are evaluated exactly once.
TEST_F
(
SingleEvaluationTest
,
ExceptionTests
)
{
TEST_F
(
SingleEvaluationTest
,
ExceptionTests
)
{
...
@@ -3371,26 +3370,6 @@ TEST_F(SingleEvaluationTest, ExceptionTests) {
...
@@ -3371,26 +3370,6 @@ TEST_F(SingleEvaluationTest, ExceptionTests) {
// failed EXPECT_ANY_THROW
// failed EXPECT_ANY_THROW
EXPECT_NONFATAL_FAILURE
(
EXPECT_ANY_THROW
(
a_
++
),
"it doesn't"
);
EXPECT_NONFATAL_FAILURE
(
EXPECT_ANY_THROW
(
a_
++
),
"it doesn't"
);
EXPECT_EQ
(
7
,
a_
);
EXPECT_EQ
(
7
,
a_
);
// failed EXPECT_THROW std::exception, throws different
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
{
// NOLINT
a_
++
;
ThrowAnInteger
();
},
std
::
exception
),
"throws a different type"
);
EXPECT_EQ
(
8
,
a_
);
// failed EXPECT_THROW, throws std::exception
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
{
// NOLINT
a_
++
;
ThrowAnException
(
"blablubb"
);
},
bool
),
"throws a different type with message: blablubb"
);
EXPECT_EQ
(
9
,
a_
);
}
}
#endif // GTEST_HAS_EXCEPTIONS
#endif // GTEST_HAS_EXCEPTIONS
...
@@ -3823,11 +3802,6 @@ TEST(AssertionTest, ASSERT_THROW) {
...
@@ -3823,11 +3802,6 @@ TEST(AssertionTest, ASSERT_THROW) {
ASSERT_THROW
(
ThrowNothing
(),
bool
),
ASSERT_THROW
(
ThrowNothing
(),
bool
),
"Expected: ThrowNothing() throws an exception of type bool.
\n
"
"Expected: ThrowNothing() throws an exception of type bool.
\n
"
" Actual: it throws nothing."
);
" Actual: it throws nothing."
);
EXPECT_FATAL_FAILURE
(
ASSERT_THROW
(
ThrowAnException
(
"b"
),
bool
),
"Expected: ThrowAnException(
\"
b
\"
) throws an exception of type bool.
\n
"
" Actual: it throws a different type with message: b"
);
}
}
// Tests ASSERT_NO_THROW.
// Tests ASSERT_NO_THROW.
...
@@ -3836,9 +3810,6 @@ TEST(AssertionTest, ASSERT_NO_THROW) {
...
@@ -3836,9 +3810,6 @@ TEST(AssertionTest, ASSERT_NO_THROW) {
EXPECT_FATAL_FAILURE
(
ASSERT_NO_THROW
(
ThrowAnInteger
()),
EXPECT_FATAL_FAILURE
(
ASSERT_NO_THROW
(
ThrowAnInteger
()),
"Expected: ThrowAnInteger() doesn't throw an exception."
"Expected: ThrowAnInteger() doesn't throw an exception."
"
\n
Actual: it throws."
);
"
\n
Actual: it throws."
);
EXPECT_FATAL_FAILURE
(
ASSERT_NO_THROW
(
ThrowAnException
(
"blablubb"
)),
"Expected: ThrowAnException(
\"
blablubb
\"
) doesn't throw"
" an exception.
\n
Actual: it throws: blablubb"
);
}
}
// Tests ASSERT_ANY_THROW.
// Tests ASSERT_ANY_THROW.
...
@@ -4565,17 +4536,13 @@ TEST(ExpectTest, EXPECT_GT) {
...
@@ -4565,17 +4536,13 @@ TEST(ExpectTest, EXPECT_GT) {
// Tests EXPECT_THROW.
// Tests EXPECT_THROW.
TEST
(
ExpectTest
,
EXPECT_THROW
)
{
TEST
(
ExpectTest
,
EXPECT_THROW
)
{
EXPECT_THROW
(
ThrowAnInteger
(),
int
);
EXPECT_THROW
(
ThrowAnInteger
(),
int
);
EXPECT_THROW
(
ThrowAnException
(
""
),
std
::
exception
);
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
ThrowAnInteger
(),
bool
),
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
ThrowAnInteger
(),
bool
),
"Expected: ThrowAnInteger() throws an exception of "
"Expected: ThrowAnInteger() throws an exception of "
"type bool.
\n
Actual: it throws a different type."
);
"type bool.
\n
Actual: it throws a different type."
);
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
ThrowNothing
(),
bool
),
EXPECT_NONFATAL_FAILURE
(
"Expected: ThrowNothing() throws an exception of "
EXPECT_THROW
(
ThrowNothing
(),
bool
),
"type bool.
\n
Actual: it throws nothing."
);
"Expected: ThrowNothing() throws an exception of type bool.
\n
"
EXPECT_NONFATAL_FAILURE
(
EXPECT_THROW
(
ThrowAnException
(
"buuh"
),
bool
),
" Actual: it throws nothing."
);
"Expected: ThrowAnException(
\"
buuh
\"
) throws an "
"exception of type bool.
\n
Actual: "
"it throws a different type with message: buuh"
);
}
}
// Tests EXPECT_NO_THROW.
// Tests EXPECT_NO_THROW.
...
@@ -4584,9 +4551,6 @@ TEST(ExpectTest, EXPECT_NO_THROW) {
...
@@ -4584,9 +4551,6 @@ TEST(ExpectTest, EXPECT_NO_THROW) {
EXPECT_NONFATAL_FAILURE
(
EXPECT_NO_THROW
(
ThrowAnInteger
()),
EXPECT_NONFATAL_FAILURE
(
EXPECT_NO_THROW
(
ThrowAnInteger
()),
"Expected: ThrowAnInteger() doesn't throw an "
"Expected: ThrowAnInteger() doesn't throw an "
"exception.
\n
Actual: it throws."
);
"exception.
\n
Actual: it throws."
);
EXPECT_NONFATAL_FAILURE
(
EXPECT_NO_THROW
(
ThrowAnException
(
"blah"
)),
"Expected: ThrowAnException(
\"
blah
\"
) doesn't "
"throw an exception.
\n
Actual: it throws: blah"
);
}
}
// Tests EXPECT_ANY_THROW.
// Tests EXPECT_ANY_THROW.
...
...
googletest/xcode/Config/General.xcconfig
View file @
907ae9ed
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
// https://github.com/google/google-toolbox-for-mac
// https://github.com/google/google-toolbox-for-mac
//
//
// Build for PPC and Intel
, 32- and
64-bit
// Build for PPC and Intel 64-bit
ARCHS =
i386
x86_64 ppc ppc64
ARCHS = x86_64 ppc ppc64
// Zerolink prevents link warnings so turn it off
// Zerolink prevents link warnings so turn it off
ZERO_LINK = NO
ZERO_LINK = NO
...
...
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