37 |
#include <config.h> |
#include <config.h> |
38 |
#endif |
#endif |
39 |
|
|
40 |
|
#ifdef _WIN32 |
41 |
|
#define snprintf _snprintf |
42 |
|
#endif |
43 |
|
|
44 |
#include <stdio.h> |
#include <stdio.h> |
45 |
#include <cassert> |
#include <cassert> |
46 |
#include <vector> |
#include <vector> |
914 |
#ifdef HAVE_LONG_LONG |
#ifdef HAVE_LONG_LONG |
915 |
# if defined(__MINGW__) || defined(__MINGW32__) |
# if defined(__MINGW__) || defined(__MINGW32__) |
916 |
# define LLD "%I64d" |
# define LLD "%I64d" |
917 |
|
# define LLU "%I64u" |
918 |
# else |
# else |
919 |
# define LLD "%lld" |
# define LLD "%lld" |
920 |
|
# define LLU "%llu" |
921 |
# endif |
# endif |
922 |
{ |
{ |
923 |
long long v; |
long long v; |
955 |
CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100); |
CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100); |
956 |
CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100); |
CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100); |
957 |
|
|
958 |
snprintf(buf, sizeof(buf), "%llu", max_value); |
snprintf(buf, sizeof(buf), LLU, max_value); |
959 |
CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); |
CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); |
960 |
|
|
961 |
assert(buf[strlen(buf)-1] != '9'); |
assert(buf[strlen(buf)-1] != '9'); |