Skip to content

Commit 57a2423

Browse files
committed
tests: enable sign compare
Change-Id: Ib316109ef38617df9ce7bcc2851354cdf14e192a
1 parent ce9469d commit 57a2423

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if(WIN32)
2626
endif()
2727

2828
else()
29-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare -std=c++11")
29+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
3030
endif()
3131

3232
set (LIBGLM_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs)

tests/gtest-1.7.0/include/gtest/gtest.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,12 +1445,21 @@ AssertionResult CmpHelperEQ(const char* expected_expression,
14451445
// signed/unsigned mismatch.
14461446
#endif
14471447

1448+
#if defined(__GNUC__) || defined(__GNUG__)
1449+
#pragma GCC diagnostic push
1450+
#pragma GCC diagnostic ignored "-Wsign-compare"
1451+
#endif
1452+
14481453
if (expected == actual) {
14491454
return AssertionSuccess();
14501455
}
14511456

14521457
#ifdef _MSC_VER
14531458
# pragma warning(pop) // Restores the warning state.
1459+
#endif
1460+
1461+
#if defined(__GNUC__) || defined(__GNUG__)
1462+
#pragma GCC diagnostic pop
14541463
#endif
14551464

14561465
return EqFailure(expected_expression,

tests/vktestframework.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ char **VkTestFramework::ReadFileData(const char *fileName) {
598598
#endif
599599

600600
char *fdata;
601-
int count = 0;
601+
size_t count = 0;
602602
const int maxSourceStrings = 5;
603603
char **return_data =
604604
(char **)malloc(sizeof(char *) * (maxSourceStrings + 1));
@@ -631,8 +631,8 @@ char **VkTestFramework::ReadFileData(const char *fileName) {
631631
} else
632632
m_num_shader_strings = 1;
633633

634-
int len = (int)(ceil)((float)count / (float)m_num_shader_strings);
635-
int ptr_len = 0, i = 0;
634+
size_t len = (int)(ceil)((float)count / (float)m_num_shader_strings);
635+
size_t ptr_len = 0, i = 0;
636636
while (count > 0) {
637637
return_data[i] = (char *)malloc(len + 2);
638638
memcpy(return_data[i], fdata + ptr_len, len);

0 commit comments

Comments
 (0)