mirror of
https://github.com/google/benchmark.git
synced 2024-11-28 05:44:40 +00:00
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:
parent
1cca1d091c
commit
5eb16eebb3
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue