/[pcre]/code/trunk/pcrecpp_unittest.cc
ViewVC logotype

Diff of /code/trunk/pcrecpp_unittest.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 179 by ph10, Wed Jun 13 08:53:45 2007 UTC revision 193 by ph10, Mon Jul 30 11:34:18 2007 UTC
# Line 905  int main(int argc, char** argv) { Line 905  int main(int argc, char** argv) {
905      CHECK(!RE("(\\d+)").FullMatch("4294967296", &v));      CHECK(!RE("(\\d+)").FullMatch("4294967296", &v));
906    }    }
907  #ifdef HAVE_LONG_LONG  #ifdef HAVE_LONG_LONG
908    # if defined(__MINGW__) || defined(__MINGW32__)
909    #   define LLD "%I64d"
910    # else
911    #   define LLD "%lld"
912    # endif
913    {    {
914      long long v;      long long v;
915      static const long long max_value = 0x7fffffffffffffffLL;      static const long long max_value = 0x7fffffffffffffffLL;
# Line 914  int main(int argc, char** argv) { Line 919  int main(int argc, char** argv) {
919      CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);      CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
920      CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100);      CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100);
921    
922      snprintf(buf, sizeof(buf), "%lld", max_value);      snprintf(buf, sizeof(buf), LLD, max_value);
923      CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);      CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);
924    
925      snprintf(buf, sizeof(buf), "%lld", min_value);      snprintf(buf, sizeof(buf), LLD, min_value);
926      CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);      CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);
927    
928      snprintf(buf, sizeof(buf), "%lld", max_value);      snprintf(buf, sizeof(buf), LLD, max_value);
929      assert(buf[strlen(buf)-1] != '9');      assert(buf[strlen(buf)-1] != '9');
930      buf[strlen(buf)-1]++;      buf[strlen(buf)-1]++;
931      CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));      CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
932    
933      snprintf(buf, sizeof(buf), "%lld", min_value);      snprintf(buf, sizeof(buf), LLD, min_value);
934      assert(buf[strlen(buf)-1] != '9');      assert(buf[strlen(buf)-1] != '9');
935      buf[strlen(buf)-1]++;      buf[strlen(buf)-1]++;
936      CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));      CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));

Legend:
Removed from v.179  
changed lines
  Added in v.193

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12