mirror of
https://github.com/google/googletest.git
synced 2025-12-06 16:57:00 +08:00
docs: Clarify which string comparison macros support wide strings
Fixes #4843 Clarifies that only EXPECT_STREQ and EXPECT_STRNE support wide C strings (wchar_t*). The case-insensitive variants EXPECT_STRCASEEQ and EXPECT_STRCASENE do not support wide strings.
This commit is contained in:
parent
1b96fa13f5
commit
bfa18a8ae8
@ -222,8 +222,10 @@ Verifies that *`val1`*`>=`*`val2`*.
|
|||||||
The following assertions compare two **C strings**. To compare two `string`
|
The following assertions compare two **C strings**. To compare two `string`
|
||||||
objects, use [`EXPECT_EQ`](#EXPECT_EQ) or [`EXPECT_NE`](#EXPECT_NE) instead.
|
objects, use [`EXPECT_EQ`](#EXPECT_EQ) or [`EXPECT_NE`](#EXPECT_NE) instead.
|
||||||
|
|
||||||
These assertions also accept wide C strings (`wchar_t*`). If a comparison of two
|
`EXPECT_STREQ` and `EXPECT_STRNE` also accept wide C strings (`wchar_t*`).
|
||||||
wide strings fails, their values will be printed as UTF-8 narrow strings.
|
Case-insensitive variants (`EXPECT_STRCASEEQ` and `EXPECT_STRCASENE`) currently do not
|
||||||
|
support wide C strings. If a comparison of two wide strings fails, their values will be
|
||||||
|
printed as UTF-8 narrow strings.
|
||||||
|
|
||||||
To compare a C string with `NULL`, use `EXPECT_EQ(`*`c_string`*`, nullptr)` or
|
To compare a C string with `NULL`, use `EXPECT_EQ(`*`c_string`*`, nullptr)` or
|
||||||
`EXPECT_NE(`*`c_string`*`, nullptr)`.
|
`EXPECT_NE(`*`c_string`*`, nullptr)`.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user