Merge lp:~zorba-coders/zorba/bug1090083-deepEqual into lp:zorba

Proposed by Cezar Andrei
Status: Merged
Approved by: Sorin Marian Nasoi
Approved revision: 11356
Merged at revision: 11371
Proposed branch: lp:~zorba-coders/zorba/bug1090083-deepEqual
Merge into: lp:zorba
Diff against target: 58 lines (+18/-5)
2 files modified
src/runtime/sequences/sequences_impl.cpp (+18/-3)
test/fots/CMakeLists.txt (+0/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug1090083-deepEqual
Reviewer Review Type Date Requested Status
Sorin Marian Nasoi Approve
Cezar Andrei Approve
Review via email: mp+158509@code.launchpad.net

Commit message

Fix deep-equal bug 1090083.

Description of the change

Fix deep-equal bug 1090083.

To post a comment you must log in.
Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1090083-deepEqual-2013-04-11T23-43-00.553Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve, 1 Pending.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1090083-deepEqual-2013-04-15T13-13-51.893Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/sequences/sequences_impl.cpp'
2--- src/runtime/sequences/sequences_impl.cpp 2013-03-26 18:10:32 +0000
3+++ src/runtime/sequences/sequences_impl.cpp 2013-04-11 23:41:34 +0000
4@@ -926,6 +926,17 @@
5 if (! item1->getNodeName()->equals(item2->getNodeName()))
6 return false;
7
8+ TypeManager* tm = sctx->get_typemanager();
9+
10+ xqtref_t type1 = tm->create_value_type(item1.getp());
11+ xqtref_t type2 = tm->create_value_type(item2.getp());
12+
13+ const NodeXQType* nodeType1 = static_cast<const NodeXQType *>(type1.getp());
14+ const NodeXQType* nodeType2 = static_cast<const NodeXQType *>(type2.getp());
15+
16+ if ( nodeType1->get_content_type()->content_kind() != nodeType2->get_content_type()->content_kind() )
17+ return false;
18+
19 return (DeepEqualAttributes(loc,
20 sctx,
21 dctx,
22@@ -1093,6 +1104,13 @@
23 item1->isJSONArray() != item2->isJSONArray())
24 return false;
25
26+
27+ xqtref_t type1 = tm->create_value_type(item1.getp());
28+ xqtref_t type2 = tm->create_value_type(item2.getp());
29+
30+ if ( type1->content_kind() != type2->content_kind() )
31+ return false;
32+
33 if (item1->isAtomic())
34 {
35 assert(item2->isAtomic());
36@@ -1102,9 +1120,6 @@
37 collator = sctx->get_default_collator(QueryLoc::null);
38
39 // check NaN
40- xqtref_t type1 = tm->create_value_type(item1.getp());
41- xqtref_t type2 = tm->create_value_type(item2.getp());
42-
43 if (((TypeOps::is_subtype(tm, *type1, *rtm.FLOAT_TYPE_ONE)
44 &&
45 item1->getFloatValue().isNaN())
46
47=== modified file 'test/fots/CMakeLists.txt'
48--- test/fots/CMakeLists.txt 2013-04-11 18:13:48 +0000
49+++ test/fots/CMakeLists.txt 2013-04-11 23:41:34 +0000
50@@ -130,8 +130,6 @@
51 EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0)
52 EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0)
53 EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0)
54-EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-38 0)
55-EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-39 0)
56 EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002 0)
57 EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002b 0)
58 EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0)

Subscribers

People subscribed via source and target branches