Commit 287dd830 authored by Ian Petersen's avatar Ian Petersen Committed by Facebook GitHub Bot

Fix array length calculation in ConvTest.cpp

Summary:
The build with Clang 10 on iOS broke with the following error:

```
folly/test/ConvTest.cpp:321:45: error: expression does not compute the number of elements in this array; element type is 'const char *const', not 'const char *const [4]' [-Werror,-Wsizeof-array-div]
    FOR_EACH_RANGE (i, 0, sizeof(uStrings2) / sizeof(uStrings2)) {
                                 ~~~~~~~~~  ^
```

Looking at nearby uses of `FOR_EACH_RANGE`, it looks like the new compiler has caught a typo, which this diff fixes.

Reviewed By: yfeldblum

Differential Revision: D22470932

fbshipit-source-id: 3090ed9824af488fc429becf2c1084c7725daf5a
parent cbdf3df7
...@@ -318,7 +318,7 @@ void testString2Integral() { ...@@ -318,7 +318,7 @@ void testString2Integral() {
(Uint)4147483648U, (Uint)4147483648U,
(Uint)4000000000U, (Uint)4000000000U,
}; };
FOR_EACH_RANGE (i, 0, sizeof(uStrings2) / sizeof(uStrings2)) { FOR_EACH_RANGE (i, 0, sizeof(uStrings2) / sizeof(*uStrings2)) {
EXPECT_EQ(to<Uint>(uStrings2[i]), uValues2[i]); EXPECT_EQ(to<Uint>(uStrings2[i]), uValues2[i]);
if (sizeof(Int) == 4) { if (sizeof(Int) == 4) {
EXPECT_THROW(to<Sint>(uStrings2[i]), std::range_error); EXPECT_THROW(to<Sint>(uStrings2[i]), std::range_error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment