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 };
void TestCase1() {
SomeStruct someVar{1};
Long otherVar{2};
int intValue{3};
SomeStruct* ptrVar = &someVar;
SomeStruct** ptrptrVar = &ptrVar;
SomeStruct someVar;
Long otherVar;
int intValue;
SomeStruct* ptrVar;
SomeStruct** ptrptrVar;
constexpr auto constexpr_work_fine = NAMEOF(intValue);
std::cout << constexpr_work_fine << std::endl; // intValue

View file

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