Changes to arithmetic operation semantics
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/ArithmeticHelper.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/ArithmeticHelper.java
index 1647364..a90f108 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/ArithmeticHelper.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/ArithmeticHelper.java
@@ -61,7 +61,8 @@
castToDouble = new CastToDoubleOperation();
}
- public void compute(TaggedValuePointable tvp1, TaggedValuePointable tvp2, IPointable result) throws SystemException {
+ public void compute(TaggedValuePointable tvp1, TaggedValuePointable tvp2, IPointable result)
+ throws SystemException {
abvs.reset();
try {
int tid1 = getBaseTypeForArithmetics(tvp1.getTag());
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic1.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic1.xq
new file mode 100644
index 0000000..f071f44
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic1.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+null + 1
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic2.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic2.xq
new file mode 100644
index 0000000..e006645
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic2.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+null * 1
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic3.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic3.xq
new file mode 100644
index 0000000..d9554bd
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic3.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+null div 1
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic4.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic4.xq
new file mode 100644
index 0000000..8c199eb
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic4.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+null - 1
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic5.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic5.xq
new file mode 100644
index 0000000..a4f874f
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic5.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+1 + null
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic6.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic6.xq
new file mode 100644
index 0000000..7be787f
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic6.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+1 * null
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic7.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic7.xq
new file mode 100644
index 0000000..52928c4
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic7.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+1 div null
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic8.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic8.xq
new file mode 100644
index 0000000..c85fcb6
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic8.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License. :)
+
+(: Changes to arithmetic operation semantics :)
+1 - null
diff --git a/vxquery-xtest/src/test/resources/cat/FunctionsInJSONiq.xml b/vxquery-xtest/src/test/resources/cat/FunctionsInJSONiq.xml
index b879332..7f59dc4 100644
--- a/vxquery-xtest/src/test/resources/cat/FunctionsInJSONiq.xml
+++ b/vxquery-xtest/src/test/resources/cat/FunctionsInJSONiq.xml
@@ -86,4 +86,44 @@
<query name="jn_members3" date="2016-07-05"/>
<output-file compare="Text">jn_members3.txt</output-file>
</test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic1" date="2016-07-19"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic2" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic3" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic4" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic5" date="2016-07-19"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic6" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic7" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
+ <test-case name="changes-to-arithmetic-operation-semantics" FilePath="Json/Functions/" Creator="Riyafa Abdul Hameed">
+ <description>Changes to arithmetic operation semantics</description>
+ <query name="arithmetic8" date="2016-07-26"/>
+ <expected-error>XPTY0004</expected-error>
+ </test-case>
</test-group>
\ No newline at end of file