Skip to content

Commit

Permalink
Change ::testing to testing in Testing Reference doc
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 544466397
Change-Id: Icb4d5fae38361cd75d47f908886831696eb2b1c9
  • Loading branch information
Abseil Team authored and copybara-github committed Jun 29, 2023
1 parent 687c589 commit 251e720
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions docs/reference/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ custom function can be used for more control:
```cpp
INSTANTIATE_TEST_SUITE_P(
MyInstantiation, MyTestSuite,
::testing::Values(...),
[](const ::testing::TestParamInfo<MyTestSuite::ParamType>& info) {
testing::Values(...),
[](const testing::TestParamInfo<MyTestSuite::ParamType>& info) {
// Can use info.param here to generate the test suffix
std::string name = ...
return name;
Expand All @@ -148,7 +148,7 @@ type, for example:

```cpp
template <typename T>
class MyFixture : public ::testing::Test {
class MyFixture : public testing::Test {
public:
...
using List = std::list<T>;
Expand Down Expand Up @@ -324,7 +324,7 @@ Then the test code should look like:
```cpp
namespace my_namespace {

class MyClassTest : public ::testing::Test {
class MyClassTest : public testing::Test {
...
};

Expand Down Expand Up @@ -387,7 +387,7 @@ GoogleTest defines the following classes and types to help with writing tests.
### AssertionResult {#AssertionResult}
`::testing::AssertionResult`
`testing::AssertionResult`
A class for indicating whether an assertion was successful.
Expand All @@ -401,22 +401,22 @@ To create an instance of this class, use one of the factory functions
### AssertionException {#AssertionException}
`::testing::AssertionException`
`testing::AssertionException`
Exception which can be thrown from
[`TestEventListener::OnTestPartResult`](#TestEventListener::OnTestPartResult).
### EmptyTestEventListener {#EmptyTestEventListener}
`::testing::EmptyTestEventListener`
`testing::EmptyTestEventListener`
Provides an empty implementation of all methods in the
[`TestEventListener`](#TestEventListener) interface, such that a subclass only
needs to override the methods it cares about.
### Environment {#Environment}
`::testing::Environment`
`testing::Environment`
Represents a global test environment. See
[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down).
Expand All @@ -437,7 +437,7 @@ Override this to define how to tear down the environment.
### ScopedTrace {#ScopedTrace}
`::testing::ScopedTrace`
`testing::ScopedTrace`
An instance of this class causes a trace to be included in every test failure
message generated by code in the scope of the lifetime of the `ScopedTrace`
Expand All @@ -453,7 +453,7 @@ ScopedTrace(const char* file, int line, const T& message)
Example usage:

```cpp
::testing::ScopedTrace trace("file.cc", 123, "message");
testing::ScopedTrace trace("file.cc", 123, "message");
```
The resulting trace includes the given source file path and line number, and the
Expand All @@ -464,7 +464,7 @@ See also [`SCOPED_TRACE`](#SCOPED_TRACE).
### Test {#Test}
`::testing::Test`
`testing::Test`
The abstract class that all tests inherit from. `Test` is not copyable.
Expand Down Expand Up @@ -552,7 +552,7 @@ after running each individual test.
### TestWithParam {#TestWithParam}
`::testing::TestWithParam<T>`
`testing::TestWithParam<T>`
A convenience class which inherits from both [`Test`](#Test) and
[`WithParamInterface<T>`](#WithParamInterface).
Expand Down Expand Up @@ -672,7 +672,7 @@ during execution of `SetUpTestSuite` and `TearDownTestSuite`.
### TestInfo {#TestInfo}
`::testing::TestInfo`
`testing::TestInfo`
Stores information about a test.
Expand Down Expand Up @@ -751,7 +751,7 @@ Returns the result of the test. See [`TestResult`](#TestResult).
### TestParamInfo {#TestParamInfo}
`::testing::TestParamInfo<T>`
`testing::TestParamInfo<T>`
Describes a parameter to a value-parameterized test. The type `T` is the type of
the parameter.
Expand All @@ -761,7 +761,7 @@ and its integer index respectively.
### UnitTest {#UnitTest}
`::testing::UnitTest`
`testing::UnitTest`
This class contains information about the test program.
Expand Down Expand Up @@ -929,7 +929,7 @@ GoogleTest. See [`TestEventListeners`](#TestEventListeners).
### TestEventListener {#TestEventListener}
`::testing::TestEventListener`
`testing::TestEventListener`
The interface for tracing execution of tests. The methods below are listed in
the order the corresponding events are fired.
Expand Down Expand Up @@ -1027,7 +1027,7 @@ Fired after all test activities have ended.
### TestEventListeners {#TestEventListeners}
`::testing::TestEventListeners`
`testing::TestEventListeners`
Lets users add listeners to track events in GoogleTest.
Expand Down Expand Up @@ -1072,7 +1072,7 @@ the caller and makes this function return `NULL` the next time.
### TestPartResult {#TestPartResult}
`::testing::TestPartResult`
`testing::TestPartResult`
A copyable object representing the result of a test part (i.e. an assertion or
an explicit `FAIL()`, `ADD_FAILURE()`, or `SUCCESS()`).
Expand Down Expand Up @@ -1154,7 +1154,7 @@ Returns true if and only if the test part failed.

### TestProperty {#TestProperty}

`::testing::TestProperty`
`testing::TestProperty`

A copyable object representing a user-specified test property which can be
output as a key/value string pair.
Expand All @@ -1181,7 +1181,7 @@ Sets a new value, overriding the previous one.

### TestResult {#TestResult}

`::testing::TestResult`
`testing::TestResult`

Contains information about the result of a single test.

Expand Down Expand Up @@ -1262,20 +1262,20 @@ range, aborts the program.

### TimeInMillis {#TimeInMillis}

`::testing::TimeInMillis`
`testing::TimeInMillis`

An integer type representing time in milliseconds.

### Types {#Types}

`::testing::Types<T...>`
`testing::Types<T...>`

Represents a list of types for use in typed tests and type-parameterized tests.

The template argument `T...` can be any number of types, for example:

```
::testing::Types<char, int, unsigned int>
testing::Types<char, int, unsigned int>
```

See [Typed Tests](../advanced.md#typed-tests) and
Expand All @@ -1284,7 +1284,7 @@ information.

### WithParamInterface {#WithParamInterface}

`::testing::WithParamInterface<T>`
`testing::WithParamInterface<T>`

The pure interface class that all value-parameterized tests inherit from.

Expand All @@ -1310,9 +1310,9 @@ tests.

### InitGoogleTest {#InitGoogleTest}

`void ::testing::InitGoogleTest(int* argc, char** argv)` \
`void ::testing::InitGoogleTest(int* argc, wchar_t** argv)` \
`void ::testing::InitGoogleTest()`
`void testing::InitGoogleTest(int* argc, char** argv)` \
`void testing::InitGoogleTest(int* argc, wchar_t** argv)` \
`void testing::InitGoogleTest()`

Initializes GoogleTest. This must be called before calling
[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line
Expand All @@ -1329,7 +1329,7 @@ platforms where there is no `argc`/`argv`.

### AddGlobalTestEnvironment {#AddGlobalTestEnvironment}

`Environment* ::testing::AddGlobalTestEnvironment(Environment* env)`
`Environment* testing::AddGlobalTestEnvironment(Environment* env)`

Adds a test environment to the test program. Must be called before
[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is called. See
Expand All @@ -1342,7 +1342,7 @@ See also [`Environment`](#Environment).

```cpp
template <typename Factory>
TestInfo* ::testing::RegisterTest(const char* test_suite_name, const char* test_name,
TestInfo* testing::RegisterTest(const char* test_suite_name, const char* test_name,
const char* type_param, const char* value_param,
const char* file, int line, Factory factory)
```
Expand Down Expand Up @@ -1381,27 +1381,27 @@ an all-caps name.
### AssertionSuccess {#AssertionSuccess}
`AssertionResult ::testing::AssertionSuccess()`
`AssertionResult testing::AssertionSuccess()`
Creates a successful assertion result. See
[`AssertionResult`](#AssertionResult).
### AssertionFailure {#AssertionFailure}
`AssertionResult ::testing::AssertionFailure()`
`AssertionResult testing::AssertionFailure()`
Creates a failed assertion result. Use the `<<` operator to store a failure
message:
```cpp
::testing::AssertionFailure() << "My failure message";
testing::AssertionFailure() << "My failure message";
```

See [`AssertionResult`](#AssertionResult).

### StaticAssertTypeEq {#StaticAssertTypeEq}

`::testing::StaticAssertTypeEq<T1, T2>()`
`testing::StaticAssertTypeEq<T1, T2>()`

Compile-time assertion for type equality. Compiles if and only if `T1` and `T2`
are the same type. The value it returns is irrelevant.
Expand All @@ -1410,7 +1410,7 @@ See [Type Assertions](../advanced.md#type-assertions) for more information.

### PrintToString {#PrintToString}

`std::string ::testing::PrintToString(x)`
`std::string testing::PrintToString(x)`

Prints any value `x` using GoogleTest's value printer.

Expand All @@ -1420,7 +1420,7 @@ for more information.

### PrintToStringParamName {#PrintToStringParamName}

`std::string ::testing::PrintToStringParamName(TestParamInfo<T>& info)`
`std::string testing::PrintToStringParamName(TestParamInfo<T>& info)`

A built-in parameterized test name generator which returns the result of
[`PrintToString`](#PrintToString) called on `info.param`. Does not work when the
Expand Down

0 comments on commit 251e720

Please sign in to comment.