Merge lp:~paul-lucas/zorba/bug-1175752 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 11435
Merged at revision: 11435
Proposed branch: lp:~paul-lucas/zorba/bug-1175752
Merge into: lp:zorba
Diff against target: 186 lines (+60/-26)
6 files modified
ChangeLog (+1/-0)
src/runtime/durations_dates_times/format_dateTime.cpp (+33/-17)
src/runtime/numerics/format_integer.cpp (+6/-7)
src/util/time_util.cpp (+10/-0)
src/util/time_util.h (+10/-0)
test/fots/CMakeLists.txt (+0/-2)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-1175752
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+162519@code.launchpad.net

Commit message

Now including "[Calendar: X]" for month of unsupported calendar.

Description of the change

Now including "[Calendar: X]" for month of unsupported calendar.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
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:~paul-lucas/zorba/bug-1175752 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 bug-1175752-2013-05-04T18-52-45.771Z is finished. The
  final status was:

  1 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 bug-1175752-2013-05-04T20-30-52.705Z 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.

Revision history for this message
Matthias Brantner (matthias-brantner) :
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 bug-1175752-2013-05-05T15-59-52.033Z 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 'ChangeLog'
2--- ChangeLog 2013-05-01 18:37:44 +0000
3+++ ChangeLog 2013-05-04 20:29:27 +0000
4@@ -47,6 +47,7 @@
5 * Fixed bug #1167704 (Implement [w] for ISO calendars for format-date/time functions)
6 * Fixed bug #1114228 (unrecognized options in the XQuery namespace now raise an error)
7 * Fixed bug #1124273 (xqdoc crash because of annotation literals)
8+ * Fixed bug #1175752 ("format-date-en152" and "format-dateTime-en152" failing)
9 * Fixed bug #1085408 (xs:date(): casting large year values)
10 * Fixed bug #867027 (XQST0059 error messages inconsistent)
11 * Fixed fn:nilled function
12
13=== modified file 'src/runtime/durations_dates_times/format_dateTime.cpp'
14--- src/runtime/durations_dates_times/format_dateTime.cpp 2013-04-23 06:09:42 +0000
15+++ src/runtime/durations_dates_times/format_dateTime.cpp 2013-05-04 20:29:27 +0000
16@@ -313,6 +313,22 @@
17 // no break;
18 }
19 default:
20+ int const new_mon = calendar::convert_mon_to( mon, mod.cal );
21+ if ( mod.cal_is_fallback || new_mon == -1 ) {
22+ //
23+ // Ibid: If the fallback representation uses a different calendar from
24+ // that requested, the output string must identify the calendar
25+ // actually used, for example by prefixing the string with [Calendar:
26+ // X] (where X is the calendar actually used), localized as appropriate
27+ // to the requested language.
28+ //
29+ ostringstream oss;
30+ // TODO: localize "Calendar"
31+ oss << "[Calendar: "
32+ << (new_mon == -1 ? calendar::get_default() : mod.cal) << ']';
33+ *dest += oss.str();
34+ } else
35+ mon = new_mon;
36 append_number( mon + 1, mod_copy, dest );
37 }
38 }
39@@ -552,7 +568,7 @@
40 ostringstream oss;
41 // TODO: localize "Calendar"
42 oss << "[Calendar: "
43- << ( new_wday == -1 ? calendar::get_default() : mod.cal ) << ']';
44+ << (new_wday == -1 ? calendar::get_default() : mod.cal) << ']';
45 *dest += oss.str();
46 } else
47 wday = new_wday;
48@@ -563,9 +579,9 @@
49
50 static void append_week_in_month( unsigned mday, unsigned mon, unsigned year,
51 modifier const &mod, zstring *dest ) {
52- int week = time::calendar::calc_week_in_month( mday, mon, year, mod.cal );
53+ int week = calendar::calc_week_in_month( mday, mon, year, mod.cal );
54 if ( week == -1 ) {
55- week = time::calendar::calc_week_in_month( mday, mon, year, calendar::ISO );
56+ week = calendar::calc_week_in_month( mday, mon, year, calendar::ISO );
57 ostringstream oss;
58 // TODO: localize "Calendar"
59 oss << "[Calendar: " << calendar::string_of[ calendar::ISO ] << ']';
60@@ -576,9 +592,9 @@
61
62 static void append_week_in_year( unsigned mday, unsigned mon, unsigned year,
63 modifier const &mod, zstring *dest ) {
64- int week = time::calendar::calc_week_in_year( mday, mon, year, mod.cal );
65+ int week = calendar::calc_week_in_year( mday, mon, year, mod.cal );
66 if ( week == -1 ) {
67- week = time::calendar::calc_week_in_year( mday, mon, year, calendar::ISO );
68+ week = calendar::calc_week_in_year( mday, mon, year, calendar::ISO );
69 ostringstream oss;
70 // TODO: localize "Calendar"
71 oss << "[Calendar: " << calendar::string_of[ calendar::ISO ] << ']';
72@@ -1043,23 +1059,23 @@
73 item->getStringValue2( picture_str );
74
75 if ( theChildren.size() > 2 ) {
76- consumeNext( item, theChildren[2].getp(), planState );
77- if ( !locale::parse( item->getStringValue(), &lang, &country ) ||
78- !locale::is_supported( lang, country ) ) {
79+ if ( consumeNext( item, theChildren[2].getp(), planState ) &&
80+ (!locale::parse( item->getStringValue(), &lang, &country ) ||
81+ !locale::is_supported( lang, country )) ) {
82 lang = iso639_1::unknown;
83 lang_is_fallback = true;
84 }
85
86- consumeNext( item, theChildren[3].getp(), planState );
87- item->getStringValue2( item_str );
88- // TODO: handle calendar being a QName.
89- cal = calendar::find( item_str );
90- if ( !cal )
91- cal_is_fallback = true;
92+ if ( consumeNext( item, theChildren[3].getp(), planState ) ) {
93+ // TODO: handle calendar being a QName.
94+ cal = calendar::find( item->getStringValue() );
95+ if ( !cal )
96+ cal_is_fallback = true;
97+ }
98
99- consumeNext( item, theChildren[4].getp(), planState );
100- item->getStringValue2( item_str );
101- // TODO: do something with place
102+ if ( consumeNext( item, theChildren[4].getp(), planState ) ) {
103+ // TODO: do something with place
104+ }
105 }
106
107 if ( !cal ) {
108
109=== modified file 'src/runtime/numerics/format_integer.cpp'
110--- src/runtime/numerics/format_integer.cpp 2013-05-03 23:19:41 +0000
111+++ src/runtime/numerics/format_integer.cpp 2013-05-04 20:29:27 +0000
112@@ -802,13 +802,12 @@
113 consumeNext( item, theChildren[1].getp(), planState );
114 item->getStringValue2( picture_str );
115
116- if ( theChildren.size() > 2 ) {
117- consumeNext( item, theChildren[2].getp(), planState );
118- if ( !locale::parse( item->getStringValue(), &lang, &country ) ||
119- !locale::is_supported( lang, country ) ) {
120- lang = iso639_1::unknown;
121- pic.lang_is_fallback = true;
122- }
123+ if ( theChildren.size() > 2 &&
124+ consumeNext( item, theChildren[2].getp(), planState ) &&
125+ (!locale::parse( item->getStringValue(), &lang, &country ) ||
126+ !locale::is_supported( lang, country )) ) {
127+ lang = iso639_1::unknown;
128+ pic.lang_is_fallback = true;
129 }
130
131 if ( !lang ) {
132
133=== modified file 'src/util/time_util.cpp'
134--- src/util/time_util.cpp 2013-05-03 23:19:41 +0000
135+++ src/util/time_util.cpp 2013-05-04 20:29:27 +0000
136@@ -177,6 +177,16 @@
137 }
138 }
139
140+int convert_mon_to( unsigned mon, type to ) {
141+ switch ( to ) {
142+ case AD:
143+ case ISO:
144+ return (int)mon;
145+ default:
146+ return -1;
147+ }
148+}
149+
150 int convert_wday_from( unsigned wday, type from ) {
151 switch ( from ) {
152 case AD:
153
154=== modified file 'src/util/time_util.h'
155--- src/util/time_util.h 2013-04-23 06:09:42 +0000
156+++ src/util/time_util.h 2013-05-04 20:29:27 +0000
157@@ -120,6 +120,16 @@
158 int calc_week_in_year( unsigned mday, unsigned mon, unsigned year, type cal );
159
160 /**
161+ * Converts a Unix month number to a specific calendar.
162+ *
163+ * @param mon The month to convert: [0-11].
164+ * @param to The calendar designator to convert \a mon to.
165+ * @return Returns \a mon converted to \a to or -1 if is unknown hot to
166+ * perform the conversion.
167+ */
168+ int convert_mon_to( unsigned mon, type to );
169+
170+ /**
171 * Converts a weekday number from a given calendar to the Unix interpretation
172 * [0-6] where 0 = Sunday.
173 *
174
175=== modified file 'test/fots/CMakeLists.txt'
176--- test/fots/CMakeLists.txt 2013-05-03 23:46:41 +0000
177+++ test/fots/CMakeLists.txt 2013-05-04 20:29:27 +0000
178@@ -118,8 +118,6 @@
179 #"disputed" tests. These test are run but marked as 'pass' by FOTS driver.
180 #All these entries should have a *valid* opened bug number from W3C bugzilla.
181 EXPECTED_FOTS_FAILURE (DISPUTED fn-format-integer format-integer-044 21448)
182-EXPECTED_FOTS_FAILURE (DISPUTED fn-format-date format-date-en152 21558)
183-EXPECTED_FOTS_FAILURE (DISPUTED fn-format-dateTime format-dateTime-en152 21558)
184 EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy20 21619)
185 EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy21 21619)
186 EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-001 21568)

Subscribers

People subscribed via source and target branches