Repository: vxquery Updated Branches: refs/heads/master d553a8c30 -> 7d4e8b11f
Changes to arithmetic operation semantics Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/7d4e8b11 Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/7d4e8b11 Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/7d4e8b11 Branch: refs/heads/master Commit: 7d4e8b11fe0fcd341616ff3a4ec09209f8a838ad Parents: d553a8c Author: riyafa <[email protected]> Authored: Tue Jul 26 19:03:12 2016 +0530 Committer: Preston Carman <[email protected]> Committed: Tue Jul 26 21:22:58 2016 -0700 ---------------------------------------------------------------------- .../functions/util/ArithmeticHelper.java | 3 +- .../XQuery/Json/Functions/arithmetic1.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic2.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic3.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic4.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic5.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic6.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic7.xq | 19 ++++++++++ .../XQuery/Json/Functions/arithmetic8.xq | 19 ++++++++++ .../test/resources/cat/FunctionsInJSONiq.xml | 40 ++++++++++++++++++++ 10 files changed, 194 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/ArithmeticHelper.java ---------------------------------------------------------------------- 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 @@ public class ArithmeticHelper { 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()); http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic1.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic2.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic3.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic4.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic5.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic6.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic7.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Functions/arithmetic8.xq ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/vxquery/blob/7d4e8b11/vxquery-xtest/src/test/resources/cat/FunctionsInJSONiq.xml ---------------------------------------------------------------------- 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
