Explicitly cast int literals to int8_t in tests to silence implicit-conversion warnings (#1455)

* Explicitly cast int literals to int8_t in tests so silence implicit-conversion warnings

Error came from:
```
: error: implicit conversion loses integer precision: 'const int' to 'const signed char' [-Werror,-Wimplicit-int-conversion]
```

* clang format

* undo deleted line
This commit is contained in:
Vy Nguyen 2022-08-04 04:18:19 -04:00 committed by GitHub
parent 1cca1d091c
commit 5eb16eebb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,8 +37,9 @@ TEST(AddRangeTest, Advanced64) {
TEST(AddRangeTest, FullRange8) { TEST(AddRangeTest, FullRange8) {
std::vector<int8_t> dst; std::vector<int8_t> dst;
AddRange(&dst, int8_t{1}, std::numeric_limits<int8_t>::max(), 8); AddRange(&dst, int8_t{1}, std::numeric_limits<int8_t>::max(), int8_t{8});
EXPECT_THAT(dst, testing::ElementsAre(1, 8, 64, 127)); EXPECT_THAT(
dst, testing::ElementsAre(int8_t{1}, int8_t{8}, int8_t{64}, int8_t{127}));
} }
TEST(AddRangeTest, FullRange64) { TEST(AddRangeTest, FullRange64) {
@ -128,8 +129,9 @@ TEST(AddRangeTest, FullNegativeRange64) {
TEST(AddRangeTest, Simple8) { TEST(AddRangeTest, Simple8) {
std::vector<int8_t> dst; std::vector<int8_t> dst;
AddRange<int8_t>(&dst, 1, 8, 2); AddRange<int8_t>(&dst, int8_t{1}, int8_t{8}, int8_t{2});
EXPECT_THAT(dst, testing::ElementsAre(1, 2, 4, 8)); EXPECT_THAT(dst,
testing::ElementsAre(int8_t{1}, int8_t{2}, int8_t{4}, int8_t{8}));
} }
TEST(AddCustomContext, Simple) { TEST(AddCustomContext, Simple) {