mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary:
This change will keep project consistency.
This change repeat the previous commit 582738bdc8.
That was created by sammy-SC and reviewed by shergin
That changed
* `ASSERT_TRUE` -> `EXPECT_TRUE`
* `ASSERT_NEAR` -> `EXPECT_NEAR`
* `ASSERT_EQ` -> `EXPECT_EQ`
That said
> 1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.
>
> 2. Rename tests in `RawPropsTest.cpp` from `ShadowNodeTest` to `RawPropsTest`.
>
> Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions
## Changelog
[CATEGORY] [TYPE] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/27850
Differential Revision: D19568014
Pulled By: shergin
fbshipit-source-id: 7c22cd1c7ec919675e834a060bd5e681d43a8baf
This commit is contained in:
committed by
Facebook Github Bot
parent
6f4d18790d
commit
0507d7368d
@@ -58,9 +58,9 @@ TEST(JSBigFileString, MapPartTest) {
|
||||
JSBigFileString bigStr {fd, needle.size(), offset};
|
||||
|
||||
// Test
|
||||
ASSERT_EQ(needle.length(), bigStr.size());
|
||||
EXPECT_EQ(needle.length(), bigStr.size());
|
||||
for (unsigned int i = 0; i < needle.length(); ++i) {
|
||||
ASSERT_EQ(needle[i], bigStr.c_str()[i]);
|
||||
EXPECT_EQ(needle[i], bigStr.c_str()[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,13 +96,13 @@ TEST(JSBigFileString, RemapTest) {
|
||||
int fd = tempFileFromString(data);
|
||||
JSBigFileString bigStr {fd, data.size()};
|
||||
|
||||
ASSERT_EQ(pageSize * 2, bigStr.size());
|
||||
EXPECT_EQ(pageSize * 2, bigStr.size());
|
||||
auto remapped = bigStr.c_str();
|
||||
size_t i = 0;
|
||||
for (; i < pageSize; ++i) {
|
||||
ASSERT_EQ(0x22, remapped[i]);
|
||||
EXPECT_EQ(0x22, remapped[i]);
|
||||
}
|
||||
for (; i < pageSize * 2; ++i) {
|
||||
ASSERT_EQ(0x11, remapped[i]);
|
||||
EXPECT_EQ(0x11, remapped[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user