Update primer.md

This commit is contained in:
Stian Valle 2018-07-21 15:50:45 +02:00 committed by GitHub
parent 7abf99d941
commit bb9fc6f66e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,17 +220,11 @@ 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 | | Fatal assertion | Nonfatal assertion | Verifies |
| ------------------------ | ------------------------ | ---------------------- | | ------------------------------- | ------------------------------- | -------------------------------------------------------- |
| `ASSERT_STREQ(str1,` | `EXPECT_STREQ(str1,` | the two C strings have | | `ASSERT_STREQ(str1, str2);` | `EXPECT_STREQ(str1, str2);` | the two C strings have the same content |
| `str2);` | `str2);` | the same content | | `ASSERT_STRNE(str1, str2);` | `EXPECT_STRNE(str1, str2);` | the two C strings have different contents |
| `ASSERT_STRNE(str1,` | `EXPECT_STRNE(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);` | different contents | | `ASSERT_STRCASENE(str1, str2);` | `EXPECT_STRCASENE(str1, str2);` | the two C strings have different contents, ignoring case |
| `ASSERT_STRCASEEQ(str1,` | `EXPECT_STRCASEEQ(str1,` | the two C strings have |
| `str2);` | `str2);` | the same content, |
| | | ignoring case |
| `ASSERT_STRCASENE(str1,` | `EXPECT_STRCASENE(str1,` | the two C strings have |
| `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*.