Merge lp:~nbrinza/zorba/bugs2 into lp:zorba

Proposed by Nicolae Brinza
Status: Merged
Approved by: Nicolae Brinza
Approved revision: 11025
Merged at revision: 11358
Proposed branch: lp:~nbrinza/zorba/bugs2
Merge into: lp:zorba
Diff against target: 101 lines (+25/-16)
3 files modified
src/runtime/core/arithmetic_impl.cpp (+22/-5)
src/zorbatypes/datetime/duration.cpp (+3/-1)
test/fots/CMakeLists.txt (+0/-10)
To merge this branch: bzr merge lp:~nbrinza/zorba/bugs2
Reviewer Review Type Date Requested Status
Nicolae Brinza Approve
Sorin Marian Nasoi Approve
Chris Hillery Approve
Review via email: mp+157752@code.launchpad.net

Commit message

More datetime/duration fixes.

Description of the change

More datetime/duration fixes.

To post a comment you must log in.
Revision history for this message
Nicolae Brinza (nbrinza) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~nbrinza/zorba/bugs2 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bugs2-2013-04-08T21-02-54.335Z is finished. The final
  status was:

  30 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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 bugs2-2013-04-08T21-34-55.846Z 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
Nicolae Brinza (nbrinza) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in test/fots/CMakeLists.txt

lp:~nbrinza/zorba/bugs2 updated
11025. By Nicolae Brinza

Merged with Zorba trunk

Revision history for this message
Nicolae Brinza (nbrinza) :
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 bugs2-2013-04-10T06-19-42.473Z 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/core/arithmetic_impl.cpp'
2--- src/runtime/core/arithmetic_impl.cpp 2013-04-01 21:52:20 +0000
3+++ src/runtime/core/arithmetic_impl.cpp 2013-04-10 05:51:22 +0000
4@@ -260,7 +260,13 @@
5 compute<store::XS_DATETIME,store::XS_DATETIME>
6 (result, dctx, tm, &aLoc, n0, n1);
7 }
8- else if (TypeOps::is_subtype(tm, *type1, *rtm.DURATION_TYPE_ONE ))
9+ else if (TypeOps::is_subtype(tm, *type1, *rtm.YM_DURATION_TYPE_ONE ))
10+ {
11+ return Operation::template
12+ compute<store::XS_DATETIME,store::XS_DURATION>
13+ (result, dctx, tm, &aLoc, n0, n1);
14+ }
15+ else if (TypeOps::is_subtype(tm, *type1, *rtm.DT_DURATION_TYPE_ONE ))
16 {
17 return Operation::template
18 compute<store::XS_DATETIME,store::XS_DURATION>
19@@ -275,7 +281,13 @@
20 compute<store::XS_DATE,store::XS_DATE>
21 (result, dctx, tm, &aLoc, n0, n1);
22 }
23- else if (TypeOps::is_subtype(tm, *type1, *rtm.DURATION_TYPE_ONE))
24+ else if (TypeOps::is_subtype(tm, *type1, *rtm.YM_DURATION_TYPE_ONE))
25+ {
26+ return Operation::template
27+ compute<store::XS_DATE,store::XS_DURATION>
28+ (result, dctx, tm, &aLoc, n0, n1);
29+ }
30+ else if (TypeOps::is_subtype(tm, *type1, *rtm.DT_DURATION_TYPE_ONE))
31 {
32 return Operation::template
33 compute<store::XS_DATE,store::XS_DURATION>
34@@ -732,7 +744,10 @@
35 const store::Item* i0,
36 const store::Item* i1 )
37 {
38- xs_decimal d = i0->getYearMonthDurationValue() / i1->getYearMonthDurationValue();
39+ xs_yearMonthDuration otherYMDuration = i1->getYearMonthDurationValue();
40+ if (otherYMDuration.isZero())
41+ throw XQUERY_EXCEPTION( err::FOAR0001, ERROR_LOC( loc ) );
42+ xs_decimal d = i0->getYearMonthDurationValue() / otherYMDuration;
43 return GENV_ITEMFACTORY->createDecimal(result, d);
44 }
45
46@@ -746,8 +761,10 @@
47 const store::Item* i0,
48 const store::Item* i1 )
49 {
50- xs_decimal d = i0->getDayTimeDurationValue() / i1->getDayTimeDurationValue();
51-
52+ xs_dayTimeDuration otherDTDuration = i1->getDayTimeDurationValue();
53+ if (otherDTDuration.isZero())
54+ throw XQUERY_EXCEPTION( err::FOAR0001, ERROR_LOC(loc));
55+ xs_decimal d = i0->getDayTimeDurationValue() / otherDTDuration;
56 return GENV_ITEMFACTORY->createDecimal(result, d);
57 }
58
59
60=== modified file 'src/zorbatypes/datetime/duration.cpp'
61--- src/zorbatypes/datetime/duration.cpp 2013-04-02 20:15:53 +0000
62+++ src/zorbatypes/datetime/duration.cpp 2013-04-10 05:51:22 +0000
63@@ -817,7 +817,9 @@
64
65
66 Decimal Duration::operator/(const Duration& d) const
67-{
68+{
69+ if (d.isZero())
70+ XQUERY_EXCEPTION(err::FOAR0001);
71 return Decimal( getTotalSeconds() ) / Decimal( d.getTotalSeconds() );
72 }
73
74
75=== modified file 'test/fots/CMakeLists.txt'
76--- test/fots/CMakeLists.txt 2013-04-09 23:40:45 +0000
77+++ test/fots/CMakeLists.txt 2013-04-10 05:51:22 +0000
78@@ -260,7 +260,6 @@
79 EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-053 0)
80 EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-054 0)
81 EXPECTED_FOTS_FAILURE (math-acos math-acos-003 0)
82-EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOAR0001_9 0)
83 EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0085 0)
84 EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0093a 0)
85 EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQTY0086_3 0)
86@@ -275,15 +274,6 @@
87 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-11 0)
88 EXPECTED_FOTS_FAILURE (misc-XMLEdition XML10-4ed-Excluded-char-1 0)
89 EXPECTED_FOTS_FAILURE (misc-XMLEdition XML11-1ed-Included-char-1 0)
90-EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-002 0)
91-EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-004 0)
92-EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-006 0)
93-EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-008 0)
94-EXPECTED_FOTS_FAILURE (op-divide-yearMonthDuration-by-yearMonthDuration cbcl-divide-yearMonthDuration-by-yearMonthDuration-001 0)
95-EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-002 0)
96-EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-004 0)
97-EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-006 0)
98-EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-008 0)
99 EXPECTED_FOTS_FAILURE (prod-AllowingEmpty outer-013 0)
100 EXPECTED_FOTS_FAILURE (prod-Annotation annotation-3 0)
101 EXPECTED_FOTS_FAILURE (prod-Annotation annotation-26 0)

Subscribers

People subscribed via source and target branches