-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[map] infrastructure for elevation info is added. review fixes
- Loading branch information
Showing
12 changed files
with
192 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include "testing/testing.hpp" | ||
|
||
#include "base/checked_cast.hpp" | ||
|
||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wimplicitly-unsigned-literal" | ||
UNIT_TEST(IsCastValid) | ||
{ | ||
{ | ||
int8_t value = -1; | ||
TEST(base::IsCastValid<int8_t>(value), ()); | ||
TEST(base::IsCastValid<int16_t>(value), ()); | ||
TEST(base::IsCastValid<int32_t>(value), ()); | ||
TEST(base::IsCastValid<int64_t>(value), ()); | ||
|
||
TEST(!base::IsCastValid<uint8_t>(value), ()); | ||
TEST(!base::IsCastValid<uint16_t>(value), ()); | ||
TEST(!base::IsCastValid<uint32_t>(value), ()); | ||
TEST(!base::IsCastValid<uint64_t>(value), ()); | ||
} | ||
{ | ||
int64_t value = -1; | ||
TEST(base::IsCastValid<int8_t>(value), ()); | ||
TEST(base::IsCastValid<int16_t>(value), ()); | ||
TEST(base::IsCastValid<int32_t>(value), ()); | ||
TEST(base::IsCastValid<int64_t>(value), ()); | ||
|
||
TEST(!base::IsCastValid<uint8_t>(value), ()); | ||
TEST(!base::IsCastValid<uint16_t>(value), ()); | ||
TEST(!base::IsCastValid<uint32_t>(value), ()); | ||
TEST(!base::IsCastValid<uint64_t>(value), ()); | ||
} | ||
{ | ||
uint8_t value = 128; | ||
TEST(!base::IsCastValid<int8_t>(value), ()); | ||
TEST(base::IsCastValid<int16_t>(value), ()); | ||
TEST(base::IsCastValid<int32_t>(value), ()); | ||
TEST(base::IsCastValid<int64_t>(value), ()); | ||
|
||
TEST(base::IsCastValid<uint8_t>(value), ()); | ||
TEST(base::IsCastValid<uint16_t>(value), ()); | ||
TEST(base::IsCastValid<uint32_t>(value), ()); | ||
TEST(base::IsCastValid<uint64_t>(value), ()); | ||
} | ||
{ | ||
uint64_t value = 9223372036854775808; | ||
TEST(!base::IsCastValid<int8_t>(value), ()); | ||
TEST(!base::IsCastValid<int16_t>(value), ()); | ||
TEST(!base::IsCastValid<int32_t>(value), ()); | ||
TEST(!base::IsCastValid<int64_t>(value), ()); | ||
|
||
TEST(!base::IsCastValid<uint8_t>(value), ()); | ||
TEST(!base::IsCastValid<uint16_t>(value), ()); | ||
TEST(!base::IsCastValid<uint32_t>(value), ()); | ||
TEST(base::IsCastValid<uint64_t>(value), ()); | ||
} | ||
{ | ||
int64_t value = -9223372036854775808; | ||
TEST(!base::IsCastValid<int8_t>(value), ()); | ||
TEST(!base::IsCastValid<int16_t>(value), ()); | ||
TEST(!base::IsCastValid<int32_t>(value), ()); | ||
TEST(base::IsCastValid<int64_t>(value), ()); | ||
|
||
TEST(!base::IsCastValid<uint8_t>(value), ()); | ||
TEST(!base::IsCastValid<uint16_t>(value), ()); | ||
TEST(!base::IsCastValid<uint32_t>(value), ()); | ||
TEST(!base::IsCastValid<uint64_t>(value), ()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.