Sorin Marian Nasoi has proposed merging lp:~zorba-coders/zorba/fix_bug_1172276 
into lp:zorba.

Commit message:
Fix for lp:1172276:
- some of the test cases "pass" after a fix in the eval:serialization-matches 
cumulated with the fact that the serialization params from the prolog of the 
test-cases match teh Zorba default serialization params
- the rest of the failures were marked as disputed with a link to W3C bug #21868

Requested reviews:
  Sorin Marian Nasoi (sorin.marian.nasoi)
Related bugs:
  Bug #1172276 in Zorba: ""serialization-matches" assertion bug"
  https://bugs.launchpad.net/zorba/+bug/1172276

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1172276/+merge/161464
-- 
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1172276/+merge/161464
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt	2013-04-29 12:41:47 +0000
+++ test/fots/CMakeLists.txt	2013-04-29 18:02:27 +0000
@@ -135,6 +135,13 @@
 EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy21 21619)
 EXPECTED_FOTS_FAILURE (DISPUTED misc-CombinedErrorCodes XQST0085 21730)
 EXPECTED_FOTS_FAILURE (DISPUTED prod-VarDefaultValue extvardef-006b 21832)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-003 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-004 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-005 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-026 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-028 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-031 21868)
+EXPECTED_FOTS_FAILURE (DISPUTED prod-OptionDecl.serialization Serialization-032 21868)
 
 # Next three possibly unique to old RQ machine, but they need to be
 # marked for the RQ to pass.
@@ -173,7 +180,7 @@
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat60q 1167609)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat63 1167609)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat64 1167609)
-EXPECTED_FOTS_FAILURE (fn-format-number numberformat83 1167643)
+EXPECTED_FOTS_FAILURE (fn-format-number numberformat83 1167641)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat87 1167641)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat88 1167641)
 EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-001 0)
@@ -251,7 +258,6 @@
 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-6 0)
 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-9 0)
 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-10 0)
-EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-11 0)
 EXPECTED_FOTS_FAILURE (misc-XMLEdition XML10-4ed-Excluded-char-1 0)
 EXPECTED_FOTS_FAILURE (misc-XMLEdition XML11-1ed-Included-char-1 0)
 EXPECTED_FOTS_FAILURE (prod-AllowingEmpty outer-013 0)
@@ -348,16 +354,6 @@
 EXPECTED_FOTS_FAILURE (prod-ModuleImport errata8-002a 0)
 EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-pub-priv-30 0)
 EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-pub-priv-34 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-003 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-004 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-005 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-026 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-027 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-028 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-029 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-030 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-031 0)
-EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-032 0)
 EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy40 0)
 EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy41 0)
 EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy49 0)

=== modified file 'test/fots_driver/environment.xq'
--- test/fots_driver/environment.xq	2013-04-29 12:41:47 +0000
+++ test/fots_driver/environment.xq	2013-04-29 18:02:27 +0000
@@ -170,10 +170,12 @@
  : to a test-case query.
  :
  : @param $decimal-formats decimal formats.
+ : @param $namespaces the declared environment namespaces.
  : @return the decimal formats declarations.
  :)
 declare function env:decl-decimal-formats(
-  $decimal-formats as element(fots:decimal-format)*
+  $decimal-formats as element(fots:decimal-format)*,
+  $namespaces      as element(fots:namespace)*
 ) as xs:string*
 {
   if (empty($decimal-formats))
@@ -183,9 +185,10 @@
     let $default := if ($tmp/@name)
                     then ()
                     else "default"
-    let $name := if ($tmp/@name)
-                 then data($tmp/@name)
-                 else ()
+    let $name := xs:string($tmp/@name)
+    let $eqName := fn:resolve-QName(xs:string($tmp/@name), $tmp)
+    let $prefix := fn:prefix-from-QName($eqName)
+    let $namespace := $namespaces/following-sibling::*[@uri=fn:namespace-uri-from-QName($eqName)]
     return
       string-join
       (
@@ -193,7 +196,9 @@
         "declare",
         $default,
         "decimal-format",
-        $name,
+        if(exists($prefix) and empty($namespace))
+        then concat("Q{", namespace-uri-from-QName($eqName), "}", local-name-from-QName($eqName))
+        else $name,
         env:set-properties($tmp),
         ";"
       ),

=== modified file 'test/fots_driver/evaluate.xq'
--- test/fots_driver/evaluate.xq	2013-04-17 19:10:37 +0000
+++ test/fots_driver/evaluate.xq	2013-04-29 18:02:27 +0000
@@ -548,19 +548,19 @@
 ) as xs:string?
 {
   try {
-  let $serResult    := fn:serialize($result, $util:serParamXml)
-  let $serExpResult := fn:serialize($expResult, $util:serParamXml)
-  let $matchesFlags := data($expResult/@flags)
+  let $serResult := fn:serialize($result)
+  let $regex := fn:string($expResult)
+  let $flags := data($expResult/@flags)
   return
-    if (exists($matchesFlags))
+    if (exists($flags))
     then
-      if (matches($serResult, $serExpResult, $matchesFlags))
+      if (matches(trace($serResult,"1"), trace($regex,"2"), trace($flags,"flags")))
       then ()
       else concat("'serialization-matches' returned: result does not match expected result with flags '",
-                  $matchesFlags,
+                  $flags,
                   "'.")
     else
-      if (matches($serResult, $serExpResult))
+      if (matches($serResult, $regex))
       then ()
       else "'serialization-matches' returned: result does not match expected result."
   } catch * {

=== modified file 'test/fots_driver/fots-driver.xq'
--- test/fots_driver/fots-driver.xq	2013-04-24 01:35:58 +0000
+++ test/fots_driver/fots-driver.xq	2013-04-29 18:02:27 +0000
@@ -884,7 +884,9 @@
         env:decl-namespaces($env, $envCase, $test),
 
         env:decl-decimal-formats(($env/fots:decimal-format,
-                                  $envCase/fots:decimal-format)),
+                                  $envCase/fots:decimal-format),
+                                 ($env/fots:namespace,
+                                  $envCase/fots:namespace)),
 
         env:add-var-decl($env, $envCase, $envBaseURI, $testSetBaseURI),
 

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to