Use explicitly sized integers in the Conv test
authorChristopher Dykes <cdykes@fb.com>
Thu, 11 Aug 2016 21:17:31 +0000 (14:17 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Thu, 11 Aug 2016 21:23:28 +0000 (14:23 -0700)
Summary: Because the tests are explicitly dependent on the size of these types, and `long` is a different size on Windows.

Reviewed By: yfeldblum

Differential Revision: D3704488

fbshipit-source-id: e15e95242c5e9c84165a50cfd2c3bc6e0d2e0c49

folly/test/ConvTest.cpp

index 426128187a76f9ba43b7f9239715bc5e4045a12e..0ac0ed5ac62d36fb565046a45ba055655b9cecad 100644 (file)
@@ -226,8 +226,8 @@ void test128Bit2String() {
 #endif
 
 TEST(Conv, Integral2String) {
-  testIntegral2String<std::string, char, short, int, long>();
-  testIntegral2String<fbstring, char, short, int, long>();
+  testIntegral2String<std::string, int8_t, int16_t, int32_t, int64_t>();
+  testIntegral2String<fbstring, int8_t, int16_t, int32_t, int64_t>();
 
 #if FOLLY_HAVE_INT128_T
   test128Bit2String<std::string>();
@@ -423,9 +423,9 @@ void testString2Integral() {
 }
 
 TEST(Conv, String2Integral) {
-  testString2Integral<const char*, signed char, short, int, long, long long>();
-  testString2Integral<std::string, signed char, short, int, long, long long>();
-  testString2Integral<fbstring, signed char, short, int, long, long long>();
+  testString2Integral<const char*, int8_t, int16_t, int32_t, int64_t>();
+  testString2Integral<std::string, int8_t, int16_t, int32_t, int64_t>();
+  testString2Integral<fbstring, int8_t, int16_t, int32_t, int64_t>();
 
   // Testing the behavior of the StringPiece* API
   // StringPiece* normally parses as much valid data as it can,