[Pcre-svn] [897] code/trunk: Move 16-bit pre-compiled reload…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [897] code/trunk: Move 16-bit pre-compiled reloading tests to separate files that are run only
Revision: 897
          http://vcs.pcre.org/viewvc?view=rev&revision=897
Author:   ph10
Date:     2012-01-20 14:24:02 +0000 (Fri, 20 Jan 2012)


Log Message:
-----------
Move 16-bit pre-compiled reloading tests to separate files that are run only
when the link size is 2.

Modified Paths:
--------------
    code/trunk/RunTest
    code/trunk/testdata/testinput14
    code/trunk/testdata/testinput17
    code/trunk/testdata/testinput18
    code/trunk/testdata/testoutput14
    code/trunk/testdata/testoutput17
    code/trunk/testdata/testoutput18


Added Paths:
-----------
    code/trunk/testdata/testinput21
    code/trunk/testdata/testinput22
    code/trunk/testdata/testoutput21
    code/trunk/testdata/testoutput22


Modified: code/trunk/RunTest
===================================================================
--- code/trunk/RunTest    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/RunTest    2012-01-20 14:24:02 UTC (rev 897)
@@ -58,6 +58,8 @@
 do18=no
 do19=no
 do20=no
+do21=no
+do22=no


 while [ $# -gt 0 ] ; do
   case $1 in
@@ -81,6 +83,8 @@
    18) do18=yes;;
    19) do19=yes;;
    20) do20=yes;;
+   21) do21=yes;;
+   22) do22=yes;;
    -8) arg8=yes;;
   -16) arg16=yes;;
    valgrind) valgrind="valgrind -q --smc-check=all";;
@@ -194,6 +198,9 @@
   if [ $do18 = yes ] ; then
     echo "Can't run test 18 because UTF support is not configured"
   fi
+  if [ $do22 = yes ] ; then
+    echo "Can't run test 22 because UTF support is not configured"
+  fi
 fi


 if [ $ucp -eq 0 ] ; then
@@ -245,7 +252,8 @@
      $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
      $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
      $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
-     $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no ] ; then
+     $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
+     $do21 = no -a $do22 = no ] ; then
   do1=yes
   do2=yes
   do3=yes
@@ -266,6 +274,8 @@
   do18=yes
   do19=yes
   do20=yes
+  do21=yes
+  do22=yes  
 fi


 # Show which release and which test data
@@ -656,9 +666,6 @@
   if [ "$bits" = "8" ] ; then
     echo "  Skipped when running 8-bit tests"
   else
-    cp -f $testdata/saved8 testsaved8
-    cp -f $testdata/saved16LE-1 testsaved16LE-1
-    cp -f $testdata/saved16BE-1 testsaved16BE-1
     for opt in "" "-s" $jitopt; do
       $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
       if [ $? = 0 ] ; then
@@ -683,8 +690,6 @@
   elif [ $utf -eq 0 ] ; then
     echo "  Skipped because UTF-$bits support is not available"
   else
-    cp -f $testdata/saved16LE-2 testsaved16LE-2
-    cp -f $testdata/saved16BE-2 testsaved16BE-2
     for opt in "" "-s" $jitopt; do
       $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
       if [ $? = 0 ] ; then
@@ -745,6 +750,51 @@
   fi
 fi


+# Tests for reloads with 16-bit library
+
+if [ $do21 = yes ] ; then
+  echo "Test 21: reloads for the basic 16-bit library"
+  if [ "$bits" = "8" ] ; then
+    echo "  Skipped when running 8-bit tests"
+  elif [ $link_size -ne 2 ] ; then
+    echo "  Skipped because link size is not 2"
+  else
+    cp -f $testdata/saved8 testsaved8
+    cp -f $testdata/saved16LE-1 testsaved16LE-1
+    cp -f $testdata/saved16BE-1 testsaved16BE-1
+    $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
+    if [ $? = 0 ] ; then
+      $cf $testdata/testoutput21 testtry
+      if [ $? != 0 ] ; then exit 1; fi
+    else exit 1
+    fi
+    echo "  OK"
+  fi
+fi
+
+# Tests for reloads with 16-bit library (UTF-16 support)
+
+if [ $do22 = yes ] ; then
+  echo "Test 22: reloads for the 16-bit library with UTF-16 support"
+  if [ "$bits" = "8" ] ; then
+    echo "  Skipped when running 8-bit tests"
+  elif [ $utf -eq 0 ] ; then
+    echo "  Skipped because UTF-$bits support is not available"
+  elif [ $link_size -ne 2 ] ; then
+    echo "  Skipped because link size is not 2"
+  else
+    cp -f $testdata/saved16LE-2 testsaved16LE-2
+    cp -f $testdata/saved16BE-2 testsaved16BE-2
+    $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
+    if [ $? = 0 ] ; then
+      $cf $testdata/testoutput22 testtry
+      if [ $? != 0 ] ; then exit 1; fi
+    else exit 1
+    fi
+    echo "  OK"
+  fi
+fi
+
 # End of loop for 8-bit/16-bit tests
 done



Modified: code/trunk/testdata/testinput14
===================================================================
--- code/trunk/testdata/testinput14    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testinput14    2012-01-20 14:24:02 UTC (rev 897)
@@ -283,6 +283,11 @@
 \)  )*                       # optional trailing comment
 /xSI


+/-- Although this saved pattern was compiled with link-size=2, it does no harm
+to run this test with other link sizes because it is going to generated a
+"compiled in wrong mode" error as soon as it is loaded, so the link size does
+not matter. --/
+
<!testsaved16

/\h/SI

Modified: code/trunk/testdata/testinput17
===================================================================
--- code/trunk/testdata/testinput17    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testinput17    2012-01-20 14:24:02 UTC (rev 897)
@@ -213,8 +213,6 @@
 \)  )*                       # optional trailing comment
 /xSI


-<!testsaved8
-
 /[\h]/BZ
     >\x09<


@@ -274,10 +272,4 @@
 /\x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}/I
     \x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}


-/-- Generated from: ^[aL](?P<name>(?:[AaLl]+)[^xX-]*?)(?P<other>[\x{150}-\x{250}\x{300}]|[^\x{800}aAs-uS-U\x{d800}-\x{dfff}])++[^#\b\x{500}\x{1000}]{3,5}$ --/
-
-<!testsaved16LE-1
-
-<!testsaved16BE-1
-
/-- End of testinput17 --/

Modified: code/trunk/testdata/testinput18
===================================================================
--- code/trunk/testdata/testinput18    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testinput18    2012-01-20 14:24:02 UTC (rev 897)
@@ -238,12 +238,6 @@
     \x{10000}ab\>4
     \x{10000}ab\>5


-/-- Generated from: (?P<cbra1>[aZ\x{400}-\x{10ffff}]{4,}[\x{f123}\x{10039}\x{20000}-\x{21234}]?|[A-Cx-z\x{100000}-\x{1000a7}\x{101234}])(?<cb2>[^az]) --/
-
-<!testsaved16LE-2
-
-<!testsaved16BE-2
-
/\x{DF00}/8

/-- End of testinput18 --/

Added: code/trunk/testdata/testinput21
===================================================================
--- code/trunk/testdata/testinput21                            (rev 0)
+++ code/trunk/testdata/testinput21    2012-01-20 14:24:02 UTC (rev 897)
@@ -0,0 +1,12 @@
+/-- Tests for reloading pre-compile patterns. The first one gives an error
+right away. The others require the linke size to be 2. */
+
+<!testsaved8
+
+/-- Generated from: ^[aL](?P<name>(?:[AaLl]+)[^xX-]*?)(?P<other>[\x{150}-\x{250}\x{300}]|[^\x{800}aAs-uS-U\x{d800}-\x{dfff}])++[^#\b\x{500}\x{1000}]{3,5}$ --/
+
+<!testsaved16LE-1
+
+<!testsaved16BE-1
+
+/-- End of testinput21 --/


Added: code/trunk/testdata/testinput22
===================================================================
--- code/trunk/testdata/testinput22                            (rev 0)
+++ code/trunk/testdata/testinput22    2012-01-20 14:24:02 UTC (rev 897)
@@ -0,0 +1,9 @@
+/-- Tests for reloading pre-compile patterns with UTF-16 support. */
+
+/-- Generated from: (?P<cbra1>[aZ\x{400}-\x{10ffff}]{4,}[\x{f123}\x{10039}\x{20000}-\x{21234}]?|[A-Cx-z\x{100000}-\x{1000a7}\x{101234}])(?<cb2>[^az]) --/8
+
+<!testsaved16LE-2
+
+<!testsaved16BE-2
+
+/-- End of testinput22 --/


Modified: code/trunk/testdata/testoutput14
===================================================================
--- code/trunk/testdata/testoutput14    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testoutput14    2012-01-20 14:24:02 UTC (rev 897)
@@ -355,6 +355,11 @@
   9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e 
   f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f 


+/-- Although this saved pattern was compiled with link-size=2, it does no harm
+to run this test with other link sizes because it is going to generated a
+"compiled in wrong mode" error as soon as it is loaded, so the link size does
+not matter. --/
+
<!testsaved16
Compiled pattern loaded from testsaved16
No study data

Modified: code/trunk/testdata/testoutput17
===================================================================
--- code/trunk/testdata/testoutput17    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testoutput17    2012-01-20 14:24:02 UTC (rev 897)
@@ -240,12 +240,6 @@
   9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e 
   f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \xff 


-<!testsaved8
-Compiled pattern loaded from testsaved8
-No study data
-Error -28 from pcre16_fullinfo(0)
-Running in 16-bit mode but pattern was compiled in 8-bit mode
-
 /[\h]/BZ
 ------------------------------------------------------------------
         Bra
@@ -454,72 +448,4 @@
     \x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}
  0: \x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}


-/-- Generated from: ^[aL](?P<name>(?:[AaLl]+)[^xX-]*?)(?P<other>[\x{150}-\x{250}\x{300}]|[^\x{800}aAs-uS-U\x{d800}-\x{dfff}])++[^#\b\x{500}\x{1000}]{3,5}$ --/
-
-<!testsaved16LE-1
-Compiled pattern loaded from testsaved16LE-1
-Study data loaded from testsaved16LE-1
-------------------------------------------------------------------
-  0 134 Bra
-  2     ^
-  3     [La]
- 20  43 CBra 1
- 23  20 Bra
- 25     [ALal]+
- 43  20 Ket
- 45     [\x00-,.-WY-wy-\xff] (neg)*?
- 63  43 Ket
- 65  12 CBraPos 2
- 68     [\x{150}-\x{250}\x{300}]
- 77  27 Alt
- 79     [^AS-Uas-u\x{800}\x{d800}-\x{dfff}]
-104  39 KetRpos
-106     [^\x08#\x{500}\x{1000}]{3,5}
-133     $
-134 134 Ket
-136     End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
-  name    1
-  other   2
-Options: anchored
-No first char
-No need char
-Subject length lower bound = 6
-No set of starting bytes
-
-<!testsaved16BE-1
-Compiled pattern loaded from testsaved16BE-1
-Study data loaded from testsaved16BE-1
-------------------------------------------------------------------
-  0 134 Bra
-  2     ^
-  3     [La]
- 20  43 CBra 1
- 23  20 Bra
- 25     [ALal]+
- 43  20 Ket
- 45     [\x00-,.-WY-wy-\xff] (neg)*?
- 63  43 Ket
- 65  12 CBraPos 2
- 68     [\x{150}-\x{250}\x{300}]
- 77  27 Alt
- 79     [^AS-Uas-u\x{800}\x{d800}-\x{dfff}]
-104  39 KetRpos
-106     [^\x08#\x{500}\x{1000}]{3,5}
-133     $
-134 134 Ket
-136     End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
-  name    1
-  other   2
-Options: anchored
-No first char
-No need char
-Subject length lower bound = 6
-No set of starting bytes
-
 /-- End of testinput17 --/


Modified: code/trunk/testdata/testoutput18
===================================================================
--- code/trunk/testdata/testoutput18    2012-01-20 12:22:48 UTC (rev 896)
+++ code/trunk/testdata/testoutput18    2012-01-20 14:24:02 UTC (rev 897)
@@ -842,63 +842,6 @@
     \x{10000}ab\>5
 Error -24 (bad offset value)


-/-- Generated from: (?P<cbra1>[aZ\x{400}-\x{10ffff}]{4,}[\x{f123}\x{10039}\x{20000}-\x{21234}]?|[A-Cx-z\x{100000}-\x{1000a7}\x{101234}])(?<cb2>[^az]) --/
-Failed: character value in \x{...} sequence is too large at offset 49
-
-<!testsaved16LE-2
-Compiled pattern loaded from testsaved16LE-2
-Study data loaded from testsaved16LE-2
-------------------------------------------------------------------
-  0 101 Bra
-  2  45 CBra 1
-  5     [Za\x{400}-\x{10ffff}]{4,}
- 32     [\x{f123}\x{10039}\x{20000}-\x{21234}]?
- 47  30 Alt
- 49     [A-Cx-z\x{100000}-\x{1000a7}\x{101234}]
- 77  75 Ket
- 79  20 CBra 2
- 82     [\x00-`b-y{-\xff] (neg)
- 99  20 Ket
-101 101 Ket
-103     End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
-  cb2     2
-  cbra1   1
-Options: utf
-No first char
-No need char
-Subject length lower bound = 2
-No set of starting bytes
-
-<!testsaved16BE-2
-Compiled pattern loaded from testsaved16BE-2
-Study data loaded from testsaved16BE-2
-------------------------------------------------------------------
-  0 101 Bra
-  2  45 CBra 1
-  5     [Za\x{400}-\x{10ffff}]{4,}
- 32     [\x{f123}\x{10039}\x{20000}-\x{21234}]?
- 47  30 Alt
- 49     [A-Cx-z\x{100000}-\x{1000a7}\x{101234}]
- 77  75 Ket
- 79  20 CBra 2
- 82     [\x00-`b-y{-\xff] (neg)
- 99  20 Ket
-101 101 Ket
-103     End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
-  cb2     2
-  cbra1   1
-Options: utf
-No first char
-No need char
-Subject length lower bound = 2
-No set of starting bytes
-
 /\x{DF00}/8
 Failed: invalid UTF-16 string at offset 0



Added: code/trunk/testdata/testoutput21
===================================================================
--- code/trunk/testdata/testoutput21                            (rev 0)
+++ code/trunk/testdata/testoutput21    2012-01-20 14:24:02 UTC (rev 897)
@@ -0,0 +1,78 @@
+/-- Tests for reloading pre-compile patterns. The first one gives an error
+right away. The others require the linke size to be 2. */
+
+<!testsaved8
+Compiled pattern loaded from testsaved8
+No study data
+Error -28 from pcre16_fullinfo(0)
+Running in 16-bit mode but pattern was compiled in 8-bit mode
+
+/-- Generated from: ^[aL](?P<name>(?:[AaLl]+)[^xX-]*?)(?P<other>[\x{150}-\x{250}\x{300}]|[^\x{800}aAs-uS-U\x{d800}-\x{dfff}])++[^#\b\x{500}\x{1000}]{3,5}$ --/
+
+<!testsaved16LE-1
+Compiled pattern loaded from testsaved16LE-1
+Study data loaded from testsaved16LE-1
+------------------------------------------------------------------
+  0 134 Bra
+  2     ^
+  3     [La]
+ 20  43 CBra 1
+ 23  20 Bra
+ 25     [ALal]+
+ 43  20 Ket
+ 45     [\x00-,.-WY-wy-\xff] (neg)*?
+ 63  43 Ket
+ 65  12 CBraPos 2
+ 68     [\x{150}-\x{250}\x{300}]
+ 77  27 Alt
+ 79     [^AS-Uas-u\x{800}\x{d800}-\x{dfff}]
+104  39 KetRpos
+106     [^\x08#\x{500}\x{1000}]{3,5}
+133     $
+134 134 Ket
+136     End
+------------------------------------------------------------------
+Capturing subpattern count = 2
+Named capturing subpatterns:
+  name    1
+  other   2
+Options: anchored
+No first char
+No need char
+Subject length lower bound = 6
+No set of starting bytes
+
+<!testsaved16BE-1
+Compiled pattern loaded from testsaved16BE-1
+Study data loaded from testsaved16BE-1
+------------------------------------------------------------------
+  0 134 Bra
+  2     ^
+  3     [La]
+ 20  43 CBra 1
+ 23  20 Bra
+ 25     [ALal]+
+ 43  20 Ket
+ 45     [\x00-,.-WY-wy-\xff] (neg)*?
+ 63  43 Ket
+ 65  12 CBraPos 2
+ 68     [\x{150}-\x{250}\x{300}]
+ 77  27 Alt
+ 79     [^AS-Uas-u\x{800}\x{d800}-\x{dfff}]
+104  39 KetRpos
+106     [^\x08#\x{500}\x{1000}]{3,5}
+133     $
+134 134 Ket
+136     End
+------------------------------------------------------------------
+Capturing subpattern count = 2
+Named capturing subpatterns:
+  name    1
+  other   2
+Options: anchored
+No first char
+No need char
+Subject length lower bound = 6
+No set of starting bytes
+
+/-- End of testinput21 --/


Added: code/trunk/testdata/testoutput22
===================================================================
--- code/trunk/testdata/testoutput22                            (rev 0)
+++ code/trunk/testdata/testoutput22    2012-01-20 14:24:02 UTC (rev 897)
@@ -0,0 +1,59 @@
+/-- Tests for reloading pre-compile patterns with UTF-16 support. */
+
+/-- Generated from: (?P<cbra1>[aZ\x{400}-\x{10ffff}]{4,}[\x{f123}\x{10039}\x{20000}-\x{21234}]?|[A-Cx-z\x{100000}-\x{1000a7}\x{101234}])(?<cb2>[^az]) --/8
+
+<!testsaved16LE-2
+Compiled pattern loaded from testsaved16LE-2
+Study data loaded from testsaved16LE-2
+------------------------------------------------------------------
+  0 101 Bra
+  2  45 CBra 1
+  5     [Za\x{400}-\x{10ffff}]{4,}
+ 32     [\x{f123}\x{10039}\x{20000}-\x{21234}]?
+ 47  30 Alt
+ 49     [A-Cx-z\x{100000}-\x{1000a7}\x{101234}]
+ 77  75 Ket
+ 79  20 CBra 2
+ 82     [\x00-`b-y{-\xff] (neg)
+ 99  20 Ket
+101 101 Ket
+103     End
+------------------------------------------------------------------
+Capturing subpattern count = 2
+Named capturing subpatterns:
+  cb2     2
+  cbra1   1
+Options: utf
+No first char
+No need char
+Subject length lower bound = 2
+No set of starting bytes
+
+<!testsaved16BE-2
+Compiled pattern loaded from testsaved16BE-2
+Study data loaded from testsaved16BE-2
+------------------------------------------------------------------
+  0 101 Bra
+  2  45 CBra 1
+  5     [Za\x{400}-\x{10ffff}]{4,}
+ 32     [\x{f123}\x{10039}\x{20000}-\x{21234}]?
+ 47  30 Alt
+ 49     [A-Cx-z\x{100000}-\x{1000a7}\x{101234}]
+ 77  75 Ket
+ 79  20 CBra 2
+ 82     [\x00-`b-y{-\xff] (neg)
+ 99  20 Ket
+101 101 Ket
+103     End
+------------------------------------------------------------------
+Capturing subpattern count = 2
+Named capturing subpatterns:
+  cb2     2
+  cbra1   1
+Options: utf
+No first char
+No need char
+Subject length lower bound = 2
+No set of starting bytes
+
+/-- End of testinput22 --/