fix some warning in example and test

This commit is contained in:
Terik23 2018-03-28 16:55:47 +05:00
parent 441412ab7c
commit 1517b529d3
2 changed files with 15 additions and 15 deletions

View file

@ -48,11 +48,11 @@ int someVar = 0;
enum class Color { RED, GREEN, BLUE }; enum class Color { RED, GREEN, BLUE };
void TestCase1() { void TestCase1() {
SomeStruct someVar{1}; SomeStruct someVar;
Long otherVar{2}; Long otherVar;
int intValue{3}; int intValue;
SomeStruct* ptrVar = &someVar; SomeStruct* ptrVar;
SomeStruct** ptrptrVar = &ptrVar; SomeStruct** ptrptrVar;
constexpr auto constexpr_work_fine = NAMEOF(intValue); constexpr auto constexpr_work_fine = NAMEOF(intValue);
std::cout << constexpr_work_fine << std::endl; // intValue std::cout << constexpr_work_fine << std::endl; // intValue

View file

@ -52,11 +52,11 @@ int someVar = 0;
enum class Color { RED, GREEN, BLUE }; enum class Color { RED, GREEN, BLUE };
TEST_CASE("NAMEOF") { TEST_CASE("NAMEOF") {
SomeStruct someVar{1}; SomeStruct someVar;
Long otherVar{2}; Long otherVar;
int intValue{3}; int intValue;
SomeStruct* ptrVar = &someVar; SomeStruct* ptrVar;
SomeStruct** ptrptrVar = &ptrVar; SomeStruct** ptrptrVar;
SECTION("constexpr") { SECTION("constexpr") {
constexpr auto constexpr_work_fine = NAMEOF(intValue); constexpr auto constexpr_work_fine = NAMEOF(intValue);
@ -107,11 +107,11 @@ TEST_CASE("NAMEOF_TYPE") {
} }
TEST_CASE("NAMEOF_FULL") { TEST_CASE("NAMEOF_FULL") {
SomeStruct someVar{1}; SomeStruct someVar;
Long otherVar{2}; Long otherVar;
int intValue{3}; int intValue;
SomeStruct* ptrVar = &someVar; SomeStruct* ptrVar;
SomeStruct** ptrptrVar = &ptrVar; SomeStruct** ptrptrVar;
SECTION("NAMEOF_FULL") { SECTION("NAMEOF_FULL") {
REQUIRE(std::strcmp(NAMEOF_FULL(someVar), "someVar") == 0); REQUIRE(std::strcmp(NAMEOF_FULL(someVar), "someVar") == 0);