Added -Wconversion support for C++.

This commit is contained in:
Takatoshi Kondo
2019-03-20 17:35:00 +09:00
parent b759f5bdf7
commit 17267ed475
65 changed files with 498 additions and 219 deletions

View File

@@ -4,8 +4,13 @@
#include <vector>
#include <limits>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <gtest/gtest.h>
#pragma GCC diagnostic pop
#if defined(_MSC_VER) || defined(__MINGW32__)
#define msgpack_rand() ((double)rand() / RAND_MAX)
#else // _MSC_VER || __MINGW32__
@@ -26,7 +31,7 @@ const double kEPS = 1e-10;
v.push_back(numeric_limits<test_type>::min()); \
v.push_back(numeric_limits<test_type>::max()); \
for (unsigned int i = 0; i < kLoop; i++) \
v.push_back(rand()); \
v.push_back(static_cast<test_type>(rand())); \
for (unsigned int i = 0; i < v.size() ; i++) { \
test_type val = v[i]; \
msgpack_sbuffer sbuf; \
@@ -61,7 +66,7 @@ const double kEPS = 1e-10;
v.push_back(numeric_limits<test_type>::min()); \
v.push_back(numeric_limits<test_type>::max()); \
for (unsigned int i = 0; i < kLoop; i++) \
v.push_back(rand()); \
v.push_back(static_cast<test_type>(rand())); \
for (unsigned int i = 0; i < v.size() ; i++) { \
test_type val = v[i]; \
msgpack_sbuffer sbuf; \