Nicolae Brinza has proposed merging lp:~nbrinza/zorba/bugs into lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Markos Zaharioudakis (markos-za)
Related bugs:
  Bug #867256 in Zorba: ""instance of document-node(element(x))" in predicate"
  https://bugs.launchpad.net/zorba/+bug/867256

For more details, see:
https://code.launchpad.net/~nbrinza/zorba/bugs/+merge/111390

Fix for lp: bug #867256 - test Steps-leading-lone-slash-8a is failing. 

-- 
https://code.launchpad.net/~nbrinza/zorba/bugs/+merge/111390
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-06-19 17:58:10 +0000
+++ ChangeLog	2012-06-21 12:19:23 +0000
@@ -12,6 +12,7 @@
     which is only a performance bug)
 
 Bug Fixes/Other Changes:
+  * Fixed bug #867256 (document-node(element(x)) types and tests were not working correctly)
   * Fixed bug #932314 (non-comparable values must be treated as distinct by
     fn:distinct-values)
   * Fixed bug #991088$ (raise XUST0001 in trycatch with mixed updating and simple clauses)

=== modified file 'src/types/typeimpl.cpp'
--- src/types/typeimpl.cpp	2012-06-15 21:31:03 +0000
+++ src/types/typeimpl.cpp	2012-06-21 12:19:23 +0000
@@ -781,8 +781,8 @@
   bool is_element_test = (
       m_node_kind == store::StoreConsts::documentNode &&
       theContentType != NULL &&
-      theContentType->type_kind() == XQType::NODE_TYPE_KIND &&
-      dynamic_cast<const NodeXQType*>(theContentType.getp())->m_schema_test == false);
+      theContentType->type_kind() == XQType::NODE_TYPE_KIND /* &&
+      dynamic_cast<const NodeXQType*>(theContentType.getp())->m_schema_test == false */);
 
   if (m_node_kind != store::StoreConsts::elementNode &&
       m_node_kind != store::StoreConsts::attributeNode &&
@@ -842,7 +842,7 @@
   if (m_node_kind == store::StoreConsts::documentNode)
   {
     os << "document-node(";
-    
+
     if (theContentType != NULL &&
         theContentType->type_kind() == XQType::NODE_TYPE_KIND)
     {
@@ -859,7 +859,7 @@
   else
   {
     os << store::StoreConsts::toSchemaString(get_node_kind()) << "(";
-    
+
     if (m_node_name != NULL)
     {
       os << m_node_name->getStringValue();
@@ -880,9 +880,9 @@
         os << "?";
     }
   }
-  
+
   os << ")";
-  
+
   return os.str();
 }
 

=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-03.xml.res	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+true
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-05.xml.res	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+false
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-06.xml.res	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+false
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-07.xml.res	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+true
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/doc-node-schema-elem-test-08.xml.res	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+false
\ No newline at end of file

=== modified file 'test/rbkt/Queries/CMakeLists.txt'
--- test/rbkt/Queries/CMakeLists.txt	2012-06-15 21:31:03 +0000
+++ test/rbkt/Queries/CMakeLists.txt	2012-06-21 12:19:23 +0000
@@ -241,7 +241,6 @@
 ####
 IF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS)
 
-  #EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Steps-leading-lone-slash-8a 3408285)
   EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Functions/QNameFunc/NamespaceURIForPrefixFunc/K2-NamespaceURIForPrefixFunc-2 872732)
   EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Basics/EQNames/eqname-001 997045)
   EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Basics/EQNames/eqname-002 997045)

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.spec	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XPTY0004

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-01.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,10 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+let $document as document-node(schema-element(Strings)) := $source 
+return true()

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.spec	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XPTY0004

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-02.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,10 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+let $document as document-node(schema-element(Strings2)) := $source 
+return true()

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-03.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,10 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+let $document as document-node(schema-element(Strings)) := validate { $source }
+return true()

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.spec	2012-06-21 12:19:23 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XPTY0004

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-04.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,10 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+let $document as document-node(schema-element(Strings2)) := validate { $source }
+return true()

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-05.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,9 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+$source instance of document-node(schema-element(Strings))

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-06.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,9 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+$source instance of document-node(schema-element(Strings2))

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-07.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,9 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+validate{$source} instance of document-node(schema-element(Strings))

=== added file 'test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq'
--- test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/doc-node-schema-elem-test-08.xq	2012-06-21 12:19:23 +0000
@@ -0,0 +1,9 @@
+import schema default element namespace "http://www.w3.org/XQueryTestOrderBy"; at "orderData.xsd"; 
+
+declare variable $source := document { (
+    <!--comment-->, 
+    <Strings><orderData>one string</orderData></Strings>,
+    <?processing instruction?>
+  ) };
+
+validate{$source} instance of document-node(schema-element(Strings2))

=== added file 'test/rbkt/Queries/zorba/schemas/orderData.xsd'
--- test/rbkt/Queries/zorba/schemas/orderData.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/orderData.xsd	2012-06-21 12:19:23 +0000
@@ -0,0 +1,36 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:order="http://www.w3.org/XQueryTestOrderBy"; targetNamespace="http://www.w3.org/XQueryTestOrderBy"; elementFormDefault="qualified">
+	<xs:complexType name = "numbers">
+		<xs:sequence>
+			<xs:element name="orderData" type="xs:decimal" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>	
+	<xs:element name = "Strings">
+		<xs:complexType>	
+			<xs:sequence>
+				<xs:element name="orderData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>	
+	</xs:element>
+	<xs:element name = "Strings2">
+		<xs:complexType>	
+			<xs:sequence>
+				<xs:element name="orderData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>	
+	</xs:element>
+	<xs:element name = "NegativeNumbers" type = "order:numbers"/>
+	<xs:element name = "PositiveNumbers" type = "order:numbers"/>
+	<xs:element name = "SmallNegativeNumbers" type = "order:numbers"/>
+	<xs:element name = "SmallPositiveNumbers" type = "order:numbers"/>  
+	<xs:element name = "DataValues">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="order:Strings"/>
+				<xs:element ref="order:NegativeNumbers"/>
+				<xs:element ref="order:PositiveNumbers"/>
+				<xs:element ref="order:SmallNegativeNumbers"/>
+				<xs:element ref="order:SmallPositiveNumbers"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
\ No newline at end of file

-- 
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