From 1952f6b7408e8a131ad58bd9eadf1f4dd2decd6f Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Wed, 10 Feb 2016 16:05:12 -0800 Subject: [PATCH] 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 --- folly/test/StringTest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)); -- 2.34.1