From: Michael Lee Date: Thu, 11 Feb 2016 00:05:12 +0000 (-0800) Subject: Compensate for -m32 platforms. X-Git-Tag: deprecate-dynamic-initializer~81 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1952f6b7408e8a131ad58bd9eadf1f4dd2decd6f;p=folly.git Compensate for -m32 platforms. Summary: When compiled for -m32, this test fails because of the difference between longs. Reviewed By: yfeldblum Differential Revision: D2924626 fb-gh-sync-id: 8ee863fa2b6df8519bd52d0d3144697a297780bb shipit-source-id: 8ee863fa2b6df8519bd52d0d3144697a297780bb --- diff --git a/folly/test/StringTest.cpp b/folly/test/StringTest.cpp index f687213f..72e87521 100644 --- a/folly/test/StringTest.cpp +++ b/folly/test/StringTest.cpp @@ -33,9 +33,12 @@ TEST(StringPrintf, BasicTest) { TEST(StringPrintf, NumericFormats) { EXPECT_EQ("12", stringPrintf("%d", 12)); - EXPECT_EQ("5000000000", stringPrintf("%ld", 5000000000UL)); - EXPECT_EQ("5000000000", stringPrintf("%ld", 5000000000L)); - EXPECT_EQ("-5000000000", stringPrintf("%ld", -5000000000L)); + EXPECT_EQ("2000000000", stringPrintf("%ld", 2000000000ULL)); + EXPECT_EQ("2000000000", stringPrintf("%ld", 2000000000L)); + EXPECT_EQ("-2000000000", stringPrintf("%ld", -2000000000L)); + EXPECT_EQ("5000000000", stringPrintf("%lld", 5000000000ULL)); + EXPECT_EQ("5000000000", stringPrintf("%lld", 5000000000LL)); + EXPECT_EQ("-5000000000", stringPrintf("%lld", -5000000000LL)); EXPECT_EQ("-1", stringPrintf("%d", 0xffffffff)); EXPECT_EQ("-1", stringPrintf("%ld", 0xffffffffffffffff)); EXPECT_EQ("-1", stringPrintf("%ld", 0xffffffffffffffffUL));