`StrCaseEq()`, `StrCaseNe()`, `StrEq()`, and `StrNe()` work for wide
`StrCaseEq()`, `StrCaseNe()`, `StrEq()`, and `StrNe()` work for wide
strings as well.
strings as well.
...
@@ -349,7 +349,7 @@ You can make a matcher from one or more other matchers:
...
@@ -349,7 +349,7 @@ You can make a matcher from one or more other matchers:
## Matchers as Test Assertions ##
## Matchers as Test Assertions ##
|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/Primer.md#assertions) if the value of `expression` doesn't match matcher `m`.|
|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/primer.md#assertions) if the value of `expression` doesn't match matcher `m`.|
@@ -607,7 +607,6 @@ See this [recipe](CookBook.md#mocking_side_effects) for more details and an exam
...
@@ -607,7 +607,6 @@ See this [recipe](CookBook.md#mocking_side_effects) for more details and an exam
If you cannot find the answer to your question in this FAQ, there are
If you cannot find the answer to your question in this FAQ, there are
some other resources you can use:
some other resources you can use:
1. read other [documentation](Documentation.md),
1. search the mailing list [archive](http://groups.google.com/group/googlemock/topics),
1. search the mailing list [archive](http://groups.google.com/group/googlemock/topics),
1. ask it on [googlemock@googlegroups.com](mailto:googlemock@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googlemock) before you can post.).
1. ask it on [googlemock@googlegroups.com](mailto:googlemock@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googlemock) before you can post.).
Now that you have read [Primer](Primer.md) and learned how to write tests
Now that you have read [Primer](primer.md) and learned how to write tests
using Google Test, it's time to learn some new tricks. This document
using Google Test, it's time to learn some new tricks. This document
will show you more assertions as well as how to construct complex
will show you more assertions as well as how to construct complex
failure messages, propagate fatal failures, reuse and speed up your
failure messages, propagate fatal failures, reuse and speed up your
...
@@ -125,7 +125,7 @@ c is 10<br>
...
@@ -125,7 +125,7 @@ c is 10<br>
**Notes:**
**Notes:**
1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](FAQ.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it.
1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](faq.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it.
1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know.
1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know.
_Availability_: Linux, Windows, Mac.
_Availability_: Linux, Windows, Mac.
...
@@ -2413,4 +2413,4 @@ file as an example on how to compile your tests against them.
...
@@ -2413,4 +2413,4 @@ file as an example on how to compile your tests against them.
Congratulations! You've now learned more advanced Google Test tools and are
Congratulations! You've now learned more advanced Google Test tools and are
ready to tackle more complex testing tasks. If you want to dive even deeper, you
ready to tackle more complex testing tasks. If you want to dive even deeper, you
can read the [Frequently-Asked Questions](FAQ.md).
can read the [Frequently-Asked Questions](faq.md).
If you cannot find the answer to your question here, and you have read
If you cannot find the answer to your question here, and you have read
[Primer](Primer.md) and [AdvancedGuide](AdvancedGuide.md), send it to
[Primer](primer.md) and [AdvancedGuide](advanced.md), send it to
googletestframework@googlegroups.com.
googletestframework@googlegroups.com.
## Why should I use Google Test instead of my favorite C++ testing framework? ##
## Why should I use Google Test instead of my favorite C++ testing framework? ##
...
@@ -28,11 +28,11 @@ list can help you decide whether it is for you too.
...
@@ -28,11 +28,11 @@ list can help you decide whether it is for you too.
*`SCOPED_TRACE` helps you understand the context of an assertion failure when it comes from inside a sub-routine or loop.
*`SCOPED_TRACE` helps you understand the context of an assertion failure when it comes from inside a sub-routine or loop.
* You can decide which tests to run using name patterns. This saves time when you want to quickly reproduce a test failure.
* You can decide which tests to run using name patterns. This saves time when you want to quickly reproduce a test failure.
* Google Test can generate XML test result reports that can be parsed by popular continuous build system like Hudson.
* Google Test can generate XML test result reports that can be parsed by popular continuous build system like Hudson.
* Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like [global test environments](AdvancedGuide.md#global-set-up-and-tear-down) and tests parameterized by [values](AdvancedGuide.md#value-parameterized-tests) or [types](docs/AdvancedGuide.md#typed-tests), Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself. In particular, you can:
* Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like [global test environments](advanced.md#global-set-up-and-tear-down) and tests parameterized by [values](advanced.md#value-parameterized-tests) or [types](docs/advanced.md#typed-tests), Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself. In particular, you can:
* expand your testing vocabulary by defining [custom predicates](AdvancedGuide.md#predicate-assertions-for-better-error-messages),
* expand your testing vocabulary by defining [custom predicates](advanced.md#predicate-assertions-for-better-error-messages),
* teach Google Test how to [print your types](AdvancedGuide.md#teaching-google-test-how-to-print-your-values),
* teach Google Test how to [print your types](advanced.md#teaching-google-test-how-to-print-your-values),
* define your own testing macros or utilities and verify them using Google Test's [Service Provider Interface](AdvancedGuide.md#catching-failures), and
* define your own testing macros or utilities and verify them using Google Test's [Service Provider Interface](advanced.md#catching-failures), and
* reflect on the test cases or change the test output format by intercepting the [test events](AdvancedGuide.md#extending-google-test-by-handling-test-events).
* reflect on the test cases or change the test output format by intercepting the [test events](advanced.md#extending-google-test-by-handling-test-events).
## I'm getting warnings when compiling Google Test. Would you fix them? ##
## I'm getting warnings when compiling Google Test. Would you fix them? ##
@@ -229,7 +229,7 @@ A `NULL` pointer and an empty string are considered _different_.
...
@@ -229,7 +229,7 @@ A `NULL` pointer and an empty string are considered _different_.
_Availability_: Linux, Windows, Mac.
_Availability_: Linux, Windows, Mac.
See also: For more string comparison tricks (substring, prefix, suffix, and
See also: For more string comparison tricks (substring, prefix, suffix, and
regular expression matching, for example), see the [Advanced Google Test Guide](AdvancedGuide.md).
regular expression matching, for example), see the [Advanced Google Test Guide](advanced.md).
# Simple Tests #
# Simple Tests #
...
@@ -290,7 +290,7 @@ To create a fixture, just:
...
@@ -290,7 +290,7 @@ To create a fixture, just:
1. Derive a class from `::testing::Test` . Start its body with `protected:` or `public:` as we'll want to access fixture members from sub-classes.
1. Derive a class from `::testing::Test` . Start its body with `protected:` or `public:` as we'll want to access fixture members from sub-classes.
1. Inside the class, declare any objects you plan to use.
1. Inside the class, declare any objects you plan to use.
1. If necessary, write a default constructor or `SetUp()` function to prepare the objects for each test. A common mistake is to spell `SetUp()` as `Setup()` with a small `u` - don't let that happen to you.
1. If necessary, write a default constructor or `SetUp()` function to prepare the objects for each test. A common mistake is to spell `SetUp()` as `Setup()` with a small `u` - don't let that happen to you.
1. If necessary, write a destructor or `TearDown()` function to release any resources you allocated in `SetUp()` . To learn when you should use the constructor/destructor and when you should use `SetUp()/TearDown()`, read this [FAQ entry](FAQ.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function).
1. If necessary, write a destructor or `TearDown()` function to release any resources you allocated in `SetUp()` . To learn when you should use the constructor/destructor and when you should use `SetUp()/TearDown()`, read this [FAQ entry](faq.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function).
1. If needed, define subroutines for your tests to share.
1. If needed, define subroutines for your tests to share.
When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
...
@@ -494,7 +494,7 @@ int main(int argc, char **argv) {
...
@@ -494,7 +494,7 @@ int main(int argc, char **argv) {
The `::testing::InitGoogleTest()` function parses the command line for Google
The `::testing::InitGoogleTest()` function parses the command line for Google
Test flags, and removes all recognized flags. This allows the user to control a
Test flags, and removes all recognized flags. This allows the user to control a
test program's behavior via various flags, which we'll cover in [AdvancedGuide](AdvancedGuide.md).
test program's behavior via various flags, which we'll cover in [AdvancedGuide](advanced.md).
You must call this function before calling `RUN_ALL_TESTS()`, or the flags
You must call this function before calling `RUN_ALL_TESTS()`, or the flags
won't be properly initialized.
won't be properly initialized.
...
@@ -522,8 +522,8 @@ There is one more pitfall, though. If you use Google Test as a static library (t
...
@@ -522,8 +522,8 @@ There is one more pitfall, though. If you use Google Test as a static library (t
# Where to Go from Here #
# Where to Go from Here #
Congratulations! You've learned the Google Test basics. You can start writing
Congratulations! You've learned the Google Test basics. You can start writing
and running Google Test tests, read some [samples](Samples.md), or continue with
and running Google Test tests, read some [samples](samples.md), or continue with
[AdvancedGuide](AdvancedGuide.md), which describes many more useful Google Test features.
[AdvancedGuide](advanced.md), which describes many more useful Google Test features.