summaryrefslogtreecommitdiff
path: root/pcrecpp_unittest.cc
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-07-30 11:34:18 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-07-30 11:34:18 +0000
commitb71c400d5ca2a9f28d5ea12585d93767184ca9bd (patch)
treeab5af4d476fd130a7f3595d32034618306a6a180 /pcrecpp_unittest.cc
parentdc4cce45a33916c954a827f3c1dfd78a86f0e00f (diff)
downloadpcre-b71c400d5ca2a9f28d5ea12585d93767184ca9bd.tar.gz
Arrange to use "%I64d" instead of "%lld" for long printing in the pcrecpp
unittest when running under MinGW. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@193 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcrecpp_unittest.cc')
-rw-r--r--pcrecpp_unittest.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/pcrecpp_unittest.cc b/pcrecpp_unittest.cc
index bfe26e5..25be7d8 100644
--- a/pcrecpp_unittest.cc
+++ b/pcrecpp_unittest.cc
@@ -905,6 +905,11 @@ int main(int argc, char** argv) {
CHECK(!RE("(\\d+)").FullMatch("4294967296", &v));
}
#ifdef HAVE_LONG_LONG
+# if defined(__MINGW__) || defined(__MINGW32__)
+# define LLD "%I64d"
+# else
+# define LLD "%lld"
+# endif
{
long long v;
static const long long max_value = 0x7fffffffffffffffLL;
@@ -914,18 +919,18 @@ int main(int argc, char** argv) {
CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100);
- snprintf(buf, sizeof(buf), "%lld", max_value);
+ snprintf(buf, sizeof(buf), LLD, max_value);
CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);
- snprintf(buf, sizeof(buf), "%lld", min_value);
+ snprintf(buf, sizeof(buf), LLD, min_value);
CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);
- snprintf(buf, sizeof(buf), "%lld", max_value);
+ snprintf(buf, sizeof(buf), LLD, max_value);
assert(buf[strlen(buf)-1] != '9');
buf[strlen(buf)-1]++;
CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
- snprintf(buf, sizeof(buf), "%lld", min_value);
+ snprintf(buf, sizeof(buf), LLD, min_value);
assert(buf[strlen(buf)-1] != '9');
buf[strlen(buf)-1]++;
CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));