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
6c7a8bec
Commit
6c7a8bec
authored
Aug 02, 2019
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2341 from ChrisBaish:master
PiperOrigin-RevId: 261344735
parents
cc34e8fa
3525e398
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
primer.md
googletest/docs/primer.md
+10
-12
No files found.
googletest/docs/primer.md
View file @
6c7a8bec
...
@@ -221,18 +221,16 @@ as `ASSERT_EQ(expected, actual)`, so lots of existing code uses this order. Now
...
@@ -221,18 +221,16 @@ as `ASSERT_EQ(expected, actual)`, so lots of existing code uses this order. Now
The assertions in this group compare two
**C strings**
. If you want to compare
The assertions in this group compare two
**C strings**
. If you want to compare
two
`string`
objects, use
`EXPECT_EQ`
,
`EXPECT_NE`
, and etc instead.
two
`string`
objects, use
`EXPECT_EQ`
,
`EXPECT_NE`
, and etc instead.
| Fatal assertion | Nonfatal assertion | Verifies |
<!-- mdformat off(github rendering does not support multiline tables) -->
| ----------------------- | ----------------------- | ---------------------- |
|
`ASSERT_STREQ(str1, | `
EXPECT_STREQ(str1, | the two C strings have |
| Fatal assertion | Nonfatal assertion | Verifies |
: str2);
` : str2);`
: the same content :
| -------------------------- | ------------------------------ | -------------------------------------------------------- |
|
`ASSERT_STRNE(str1, | `
EXPECT_STRNE(str1, | the two C strings have |
|
`ASSERT_STREQ(str1,str2);`
|
`EXPECT_STREQ(str1,str2);`
| the two C strings have the same content |
: str2);
` : str2);`
: different contents :
|
`ASSERT_STRNE(str1,str2);`
|
`EXPECT_STRNE(str1,str2);`
| the two C strings have different contents |
|
`ASSERT_STRCASEEQ(str1, | `
EXPECT_STRCASEEQ(str1, | the two C strings have |
|
`ASSERT_STRCASEEQ(str1,str2);`
|
`EXPECT_STRCASEEQ(str1,str2);`
| the two C strings have the same content, ignoring case |
: str2);
` : str2);`
: the same content, :
|
`ASSERT_STRCASENE(str1,str2);`
|
`EXPECT_STRCASENE(str1,str2);`
| the two C strings have different contents, ignoring case |
: : : ignoring case :
|
`ASSERT_STRCASENE(str1, | `
EXPECT_STRCASENE(str1, | the two C strings have |
<!-- mdformat on-->
: str2);
` : str2);`
: different contents, :
: : : ignoring case :
Note that "CASE" in an assertion name means that case is ignored. A
`NULL`
Note that "CASE" in an assertion name means that case is ignored. A
`NULL`
pointer and an empty string are considered
*different*
.
pointer and an empty string are considered
*different*
.
...
...
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