Merge lp:~zorba-coders/zorba/bug-896426 into lp:zorba
- bug-896426
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Chris Hillery |
Approved revision: | 10558 |
Merged at revision: | 10634 |
Proposed branch: | lp:~zorba-coders/zorba/bug-896426 |
Merge into: | lp:zorba |
Diff against target: |
616 lines (+99/-62) 19 files modified
src/unit_tests/CMakeLists.txt (+19/-1) src/unit_tests/stemmer.cpp (+8/-1) src/unit_tests/string.cpp (+10/-1) src/unit_tests/string_instantiate.cpp (+8/-1) src/unit_tests/thesaurus.cpp (+8/-1) src/unit_tests/tokenizer.cpp (+8/-1) src/unit_tests/unique_ptr.cpp (+7/-1) src/unit_tests/unit_test_list.h (+8/-3) src/unit_tests/unit_tests.cpp (+9/-1) src/util/ascii_util.h (+1/-6) src/util/regex.h (+2/-2) src/util/regex_ascii.h (+0/-2) src/util/string_util.h (+0/-2) src/util/unicode_util.h (+0/-9) src/util/uri_util.h (+2/-2) src/util/utf8_util.h (+0/-5) src/util/utf8_util_base.h (+0/-12) src/util/xml_util.h (+0/-1) test/unit/CMakeLists.txt (+9/-10) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug-896426 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Hillery | Approve | ||
Paul J. Lucas | Approve | ||
Matthias Brantner | Needs Information | ||
Review via email: mp+83885@code.launchpad.net |
Commit message
Migrated several unit tests to libunittest.
Description of the change
Matthias Brantner (matthias-brantner) wrote : | # |
Paul J. Lucas (paul-lucas) wrote : | # |
It's not critical. I was hoping that Chris would have migrated more unit tests.
Chris Hillery (ceejatec) wrote : | # |
No reason not to incorporate these changes, though; I'm starting the remote queue for them (probably the branch will need to be updated from the trunk).
Zorba Build Bot (zorba-buildbot) wrote : | # |
Attempt to merge into lp:zorba failed due to conflicts:
text conflict in src/unit_
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/bug-896426 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug-896426-2012-01-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
Error in read script: /home/ceej/
Chris Hillery (ceejatec) wrote : | # |
I killed the validation queue job above. It was doomed to fail because of a mistaken merge to the trunk. I am correcting the trunk and will re-start the validation queue for this proposal when it is fixed.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-896426-2012-01-
All tests succeeded!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1. Got: 1 Needs Information, 1 Pending.
Paul J. Lucas (paul-lucas) : | # |
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-896426-2012-01-
All tests succeeded!
Paul J. Lucas (paul-lucas) wrote : | # |
Uhm.... I don't think it was ever the intention to move *all* unit tests from test/unit to src/unit_tests. Tests that test things that are *supposed* to be in the public API (as opposed to things declared ZORBA_DLL_PUBLIC just so they'd link) should *stay* in test/unit, e.g., stemmer.cpp, tokenizer.cpp, thesaurus.cpp.
Preview Diff
1 | === modified file 'src/unit_tests/CMakeLists.txt' | |||
2 | --- src/unit_tests/CMakeLists.txt 2011-12-21 14:40:33 +0000 | |||
3 | +++ src/unit_tests/CMakeLists.txt 2012-01-19 09:11:24 +0000 | |||
4 | @@ -14,6 +14,24 @@ | |||
5 | 14 | 14 | ||
6 | 15 | 15 | ||
7 | 16 | SET(UNIT_TEST_SRCS | 16 | SET(UNIT_TEST_SRCS |
8 | 17 | string_instantiate.cpp | ||
9 | 18 | string.cpp | ||
10 | 19 | test_uri.cpp | ||
11 | 20 | unique_ptr.cpp | ||
12 | 17 | unit_tests.cpp | 21 | unit_tests.cpp |
13 | 18 | test_uri.cpp | ||
14 | 19 | ) | 22 | ) |
15 | 23 | |||
16 | 24 | IF (NOT ZORBA_NO_FULL_TEXT) | ||
17 | 25 | LIST (APPEND UNIT_TEST_SRCS | ||
18 | 26 | stemmer.cpp | ||
19 | 27 | thesaurus.cpp | ||
20 | 28 | tokenizer.cpp) | ||
21 | 29 | ENDIF (NOT ZORBA_NO_FULL_TEXT) | ||
22 | 30 | |||
23 | 31 | IF(ZORBA_WITH_DEBUGGER) | ||
24 | 32 | LIST(APPEND UNIT_TEST_SRCS | ||
25 | 33 | # test_debugger_protocol.cpp | ||
26 | 34 | ) | ||
27 | 35 | ENDIF(ZORBA_WITH_DEBUGGER) | ||
28 | 36 | |||
29 | 37 | # vim:set et sw=2 tw=2: | ||
30 | 20 | 38 | ||
31 | === renamed file 'test/unit/stemmer.cpp' => 'src/unit_tests/stemmer.cpp' | |||
32 | --- test/unit/stemmer.cpp 2011-08-25 15:54:19 +0000 | |||
33 | +++ src/unit_tests/stemmer.cpp 2012-01-19 09:11:24 +0000 | |||
34 | @@ -74,7 +74,10 @@ | |||
35 | 74 | 74 | ||
36 | 75 | /////////////////////////////////////////////////////////////////////////////// | 75 | /////////////////////////////////////////////////////////////////////////////// |
37 | 76 | 76 | ||
39 | 77 | int stemmer( int argc, char *argv[] ) { | 77 | namespace zorba { |
40 | 78 | namespace UnitTests { | ||
41 | 79 | |||
42 | 80 | int test_stemmer( int argc, char *argv[] ) { | ||
43 | 78 | void *const zstore = StoreManager::getStore(); | 81 | void *const zstore = StoreManager::getStore(); |
44 | 79 | Zorba *const zorba = Zorba::getInstance( zstore ); | 82 | Zorba *const zorba = Zorba::getInstance( zstore ); |
45 | 80 | 83 | ||
46 | @@ -113,4 +116,8 @@ | |||
47 | 113 | StoreManager::shutdownStore( zstore ); | 116 | StoreManager::shutdownStore( zstore ); |
48 | 114 | return result; | 117 | return result; |
49 | 115 | } | 118 | } |
50 | 119 | |||
51 | 120 | } // namespace UnitTests | ||
52 | 121 | } // namespace zorba | ||
53 | 122 | |||
54 | 116 | /* vim:set et sw=2 ts=2: */ | 123 | /* vim:set et sw=2 ts=2: */ |
55 | 117 | 124 | ||
56 | === renamed file 'test/unit/string_test.cpp' => 'src/unit_tests/string.cpp' | |||
57 | --- test/unit/string_test.cpp 2011-08-24 12:48:09 +0000 | |||
58 | +++ src/unit_tests/string.cpp 2012-01-19 09:11:24 +0000 | |||
59 | @@ -778,7 +778,12 @@ | |||
60 | 778 | ASSERT_TRUE( xml::parse_entity( "&", &c ) == -1 ); | 778 | ASSERT_TRUE( xml::parse_entity( "&", &c ) == -1 ); |
61 | 779 | } | 779 | } |
62 | 780 | 780 | ||
64 | 781 | int string_test( int, char*[] ) { | 781 | /////////////////////////////////////////////////////////////////////////////// |
65 | 782 | |||
66 | 783 | namespace zorba { | ||
67 | 784 | namespace UnitTests { | ||
68 | 785 | |||
69 | 786 | int test_string( int, char*[] ) { | ||
70 | 782 | 787 | ||
71 | 783 | ////////// basic string functionality /////////////////////////////////////// | 788 | ////////// basic string functionality /////////////////////////////////////// |
72 | 784 | 789 | ||
73 | @@ -898,4 +903,8 @@ | |||
74 | 898 | cout << failures << " test(s) failed\n"; | 903 | cout << failures << " test(s) failed\n"; |
75 | 899 | return failures ? 1 : 0; | 904 | return failures ? 1 : 0; |
76 | 900 | } | 905 | } |
77 | 906 | |||
78 | 907 | } // namespace UnitTests | ||
79 | 908 | } // namespace zorba | ||
80 | 909 | |||
81 | 901 | /* vim:set et sw=2 ts=2: */ | 910 | /* vim:set et sw=2 ts=2: */ |
82 | 902 | 911 | ||
83 | === renamed file 'test/unit/string_instantiate.cpp' => 'src/unit_tests/string_instantiate.cpp' | |||
84 | --- test/unit/string_instantiate.cpp 2011-06-14 17:26:33 +0000 | |||
85 | +++ src/unit_tests/string_instantiate.cpp 2012-01-19 09:11:24 +0000 | |||
86 | @@ -547,7 +547,10 @@ | |||
87 | 547 | 547 | ||
88 | 548 | /////////////////////////////////////////////////////////////////////////////// | 548 | /////////////////////////////////////////////////////////////////////////////// |
89 | 549 | 549 | ||
91 | 550 | int string_instantiate( int, char*[] ) { | 550 | namespace zorba { |
92 | 551 | namespace UnitTests { | ||
93 | 552 | |||
94 | 553 | int test_string_instantiate( int, char*[] ) { | ||
95 | 551 | return 0; // don't actually call anything | 554 | return 0; // don't actually call anything |
96 | 552 | 555 | ||
97 | 553 | instantiate_common<zstring>(); | 556 | instantiate_common<zstring>(); |
98 | @@ -570,4 +573,8 @@ | |||
99 | 570 | 573 | ||
100 | 571 | return 0; | 574 | return 0; |
101 | 572 | } | 575 | } |
102 | 576 | |||
103 | 577 | } // namespace UnitTests | ||
104 | 578 | } // namespace zorba | ||
105 | 579 | |||
106 | 573 | /* vim:set et sw=2 ts=2: */ | 580 | /* vim:set et sw=2 ts=2: */ |
107 | 574 | 581 | ||
108 | === renamed file 'test/unit/thesaurus.cpp' => 'src/unit_tests/thesaurus.cpp' | |||
109 | --- test/unit/thesaurus.cpp 2011-10-24 23:26:11 +0000 | |||
110 | +++ src/unit_tests/thesaurus.cpp 2012-01-19 09:11:24 +0000 | |||
111 | @@ -118,7 +118,10 @@ | |||
112 | 118 | 118 | ||
113 | 119 | /////////////////////////////////////////////////////////////////////////////// | 119 | /////////////////////////////////////////////////////////////////////////////// |
114 | 120 | 120 | ||
116 | 121 | int thesaurus( int argc, char *argv[] ) { | 121 | namespace zorba { |
117 | 122 | namespace UnitTests { | ||
118 | 123 | |||
119 | 124 | int test_thesaurus( int argc, char *argv[] ) { | ||
120 | 122 | void *const zstore = StoreManager::getStore(); | 125 | void *const zstore = StoreManager::getStore(); |
121 | 123 | Zorba *const zorba = Zorba::getInstance( zstore ); | 126 | Zorba *const zorba = Zorba::getInstance( zstore ); |
122 | 124 | 127 | ||
123 | @@ -157,4 +160,8 @@ | |||
124 | 157 | StoreManager::shutdownStore( zstore ); | 160 | StoreManager::shutdownStore( zstore ); |
125 | 158 | return result; | 161 | return result; |
126 | 159 | } | 162 | } |
127 | 163 | |||
128 | 164 | } // namespace UnitTests | ||
129 | 165 | } // namespace zorba | ||
130 | 166 | |||
131 | 160 | /* vim:set et sw=2 ts=2: */ | 167 | /* vim:set et sw=2 ts=2: */ |
132 | 161 | 168 | ||
133 | === renamed file 'test/unit/tokenizer.cpp' => 'src/unit_tests/tokenizer.cpp' | |||
134 | --- test/unit/tokenizer.cpp 2011-08-31 01:59:30 +0000 | |||
135 | +++ src/unit_tests/tokenizer.cpp 2012-01-19 09:11:24 +0000 | |||
136 | @@ -341,7 +341,10 @@ | |||
137 | 341 | 341 | ||
138 | 342 | /////////////////////////////////////////////////////////////////////////////// | 342 | /////////////////////////////////////////////////////////////////////////////// |
139 | 343 | 343 | ||
141 | 344 | int tokenizer( int argc, char *argv[] ) { | 344 | namespace zorba { |
142 | 345 | namespace UnitTests { | ||
143 | 346 | |||
144 | 347 | int test_tokenizer( int argc, char *argv[] ) { | ||
145 | 345 | int result = 0; | 348 | int result = 0; |
146 | 346 | 349 | ||
147 | 347 | void *const zstore = StoreManager::getStore(); | 350 | void *const zstore = StoreManager::getStore(); |
148 | @@ -389,4 +392,8 @@ | |||
149 | 389 | StoreManager::shutdownStore( zstore ); | 392 | StoreManager::shutdownStore( zstore ); |
150 | 390 | return result; | 393 | return result; |
151 | 391 | } | 394 | } |
152 | 395 | |||
153 | 396 | } // namespace UnitTests | ||
154 | 397 | } // namespace zorba | ||
155 | 398 | |||
156 | 392 | /* vim:set et sw=2 ts=2: */ | 399 | /* vim:set et sw=2 ts=2: */ |
157 | 393 | 400 | ||
158 | === renamed file 'test/unit/unique_ptr.cpp' => 'src/unit_tests/unique_ptr.cpp' | |||
159 | --- test/unit/unique_ptr.cpp 2011-08-27 14:57:52 +0000 | |||
160 | +++ src/unit_tests/unique_ptr.cpp 2012-01-19 09:11:24 +0000 | |||
161 | @@ -221,7 +221,10 @@ | |||
162 | 221 | 221 | ||
163 | 222 | /////////////////////////////////////////////////////////////////////////////// | 222 | /////////////////////////////////////////////////////////////////////////////// |
164 | 223 | 223 | ||
166 | 224 | int unique_ptr( int, char*[] ) { | 224 | namespace zorba { |
167 | 225 | namespace UnitTests { | ||
168 | 226 | |||
169 | 227 | int test_unique_ptr( int, char*[] ) { | ||
170 | 225 | compile_test(); | 228 | compile_test(); |
171 | 226 | test_array(); | 229 | test_array(); |
172 | 227 | test_basic(); | 230 | test_basic(); |
173 | @@ -239,6 +242,9 @@ | |||
174 | 239 | return failures ? 1 : 0; | 242 | return failures ? 1 : 0; |
175 | 240 | } | 243 | } |
176 | 241 | 244 | ||
177 | 245 | } // namespace UnitTests | ||
178 | 246 | } // namespace zorba | ||
179 | 247 | |||
180 | 242 | /////////////////////////////////////////////////////////////////////////////// | 248 | /////////////////////////////////////////////////////////////////////////////// |
181 | 243 | 249 | ||
182 | 244 | /* vim:set et sw=2 ts=2: */ | 250 | /* vim:set et sw=2 ts=2: */ |
183 | 245 | 251 | ||
184 | === modified file 'src/unit_tests/unit_test_list.h' | |||
185 | --- src/unit_tests/unit_test_list.h 2011-06-14 17:26:33 +0000 | |||
186 | +++ src/unit_tests/unit_test_list.h 2012-01-19 09:11:24 +0000 | |||
187 | @@ -17,19 +17,24 @@ | |||
188 | 17 | #ifndef ZORBA_UNIT_TEST_LIST_H | 17 | #ifndef ZORBA_UNIT_TEST_LIST_H |
189 | 18 | #define ZORBA_UNIT_TEST_LIST_H | 18 | #define ZORBA_UNIT_TEST_LIST_H |
190 | 19 | 19 | ||
193 | 20 | #include <iostream> | 20 | #include <zorba/config.h> |
192 | 21 | |||
194 | 22 | 21 | ||
195 | 23 | namespace zorba { | 22 | namespace zorba { |
196 | 24 | 23 | ||
197 | 25 | namespace UnitTests { | 24 | namespace UnitTests { |
198 | 26 | int runUriTest(int argc, char* argv[]); | 25 | int runUriTest(int argc, char* argv[]); |
199 | 27 | int runDebuggerProtocolTest(int argc, char* argv[]); | 26 | int runDebuggerProtocolTest(int argc, char* argv[]); |
200 | 27 | int test_string( int, char*[] ); | ||
201 | 28 | int test_unique_ptr( int, char*[] ); | ||
202 | 29 | #ifndef ZORBA_NO_FULL_TEXT | ||
203 | 30 | int test_stemmer( int, char*[] ); | ||
204 | 31 | int test_thesaurus( int, char*[] ); | ||
205 | 32 | int test_tokenizer( int, char*[] ); | ||
206 | 33 | #endif /* ZORBA_NO_FULL_TEXT */ | ||
207 | 28 | /** | 34 | /** |
208 | 29 | * ADD NEW UNIT TESTS HERE | 35 | * ADD NEW UNIT TESTS HERE |
209 | 30 | */ | 36 | */ |
210 | 31 | 37 | ||
211 | 32 | |||
212 | 33 | void initializeTestList(); | 38 | void initializeTestList(); |
213 | 34 | }; | 39 | }; |
214 | 35 | 40 | ||
215 | 36 | 41 | ||
216 | === modified file 'src/unit_tests/unit_tests.cpp' | |||
217 | --- src/unit_tests/unit_tests.cpp 2011-06-14 17:26:33 +0000 | |||
218 | +++ src/unit_tests/unit_tests.cpp 2012-01-19 09:11:24 +0000 | |||
219 | @@ -37,10 +37,18 @@ | |||
220 | 37 | * ADD NEW UNIT TESTS HERE | 37 | * ADD NEW UNIT TESTS HERE |
221 | 38 | */ | 38 | */ |
222 | 39 | void initializeTestList() { | 39 | void initializeTestList() { |
223 | 40 | libunittests["string"] = test_string; | ||
224 | 40 | libunittests["uri"] = runUriTest; | 41 | libunittests["uri"] = runUriTest; |
225 | 42 | libunittests["unique_ptr"] = test_unique_ptr; | ||
226 | 43 | #ifndef ZORBA_NO_FULL_TEXT | ||
227 | 44 | libunittests["stemmer"] = test_stemmer; | ||
228 | 45 | libunittests["thesaurus"] = test_thesaurus; | ||
229 | 46 | libunittests["tokenizer"] = test_tokenizer; | ||
230 | 47 | #endif /* ZORBA_NO_FULL_TEXT */ | ||
231 | 48 | |||
232 | 41 | #ifdef ZORBA_WITH_DEBUGGER | 49 | #ifdef ZORBA_WITH_DEBUGGER |
233 | 42 | // libunittests["debugger_protocol"] = runDebuggerProtocolTest; | 50 | // libunittests["debugger_protocol"] = runDebuggerProtocolTest; |
235 | 43 | #endif | 51 | #endif /* ZORBA_WITH_DEBUGGER */ |
236 | 44 | } | 52 | } |
237 | 45 | 53 | ||
238 | 46 | int runUnitTest(int argc, char* argv[]) { | 54 | int runUnitTest(int argc, char* argv[]) { |
239 | 47 | 55 | ||
240 | === modified file 'src/util/ascii_util.h' | |||
241 | --- src/util/ascii_util.h 2011-06-19 16:17:46 +0000 | |||
242 | +++ src/util/ascii_util.h 2012-01-19 09:11:24 +0000 | |||
243 | @@ -22,8 +22,6 @@ | |||
244 | 22 | #include <cstddef> | 22 | #include <cstddef> |
245 | 23 | #include <cstring> | 23 | #include <cstring> |
246 | 24 | 24 | ||
247 | 25 | #include <zorba/config.h> | ||
248 | 26 | |||
249 | 27 | #include "stl_util.h" | 25 | #include "stl_util.h" |
250 | 28 | 26 | ||
251 | 29 | namespace zorba { | 27 | namespace zorba { |
252 | @@ -205,7 +203,7 @@ | |||
253 | 205 | * @param s The NULL-terminated C string to check. | 203 | * @param s The NULL-terminated C string to check. |
254 | 206 | * @return Returns \c true only if the entire string is whitespace. | 204 | * @return Returns \c true only if the entire string is whitespace. |
255 | 207 | */ | 205 | */ |
257 | 208 | ZORBA_DLL_PUBLIC bool is_whitespace( char const *s ); | 206 | bool is_whitespace( char const *s ); |
258 | 209 | 207 | ||
259 | 210 | /** | 208 | /** |
260 | 211 | * Checks whether an entire string is whitespace. | 209 | * Checks whether an entire string is whitespace. |
261 | @@ -684,7 +682,6 @@ | |||
262 | 684 | * @return Returns a pointer to the first character in \a s that is not among | 682 | * @return Returns a pointer to the first character in \a s that is not among |
263 | 685 | * the characters in \a chars. | 683 | * the characters in \a chars. |
264 | 686 | */ | 684 | */ |
265 | 687 | ZORBA_DLL_PUBLIC | ||
266 | 688 | char const* trim_start( char const *s, char const *chars ); | 685 | char const* trim_start( char const *s, char const *chars ); |
267 | 689 | 686 | ||
268 | 690 | /** | 687 | /** |
269 | @@ -696,7 +693,6 @@ | |||
270 | 696 | * @return Returns a pointer to the first character in \a s that is not among | 693 | * @return Returns a pointer to the first character in \a s that is not among |
271 | 697 | * the characters in \a chars. | 694 | * the characters in \a chars. |
272 | 698 | */ | 695 | */ |
273 | 699 | ZORBA_DLL_PUBLIC | ||
274 | 700 | char const* trim_start( char const *s, size_type s_len, char const *chars ); | 696 | char const* trim_start( char const *s, size_type s_len, char const *chars ); |
275 | 701 | 697 | ||
276 | 702 | /** | 698 | /** |
277 | @@ -782,7 +778,6 @@ | |||
278 | 782 | * @param chars The characters to trim. | 778 | * @param chars The characters to trim. |
279 | 783 | * @return Returns the new length of \a s. | 779 | * @return Returns the new length of \a s. |
280 | 784 | */ | 780 | */ |
281 | 785 | ZORBA_DLL_PUBLIC | ||
282 | 786 | size_type trim_end( char const *s, size_type s_len, char const *chars ); | 781 | size_type trim_end( char const *s, size_type s_len, char const *chars ); |
283 | 787 | 782 | ||
284 | 788 | /** | 783 | /** |
285 | 789 | 784 | ||
286 | === modified file 'src/util/regex.h' | |||
287 | --- src/util/regex.h 2011-07-18 14:25:21 +0000 | |||
288 | +++ src/util/regex.h 2012-01-19 09:11:24 +0000 | |||
289 | @@ -48,7 +48,7 @@ | |||
290 | 48 | /** | 48 | /** |
291 | 49 | * The %regex class wraps the underlying Unicode regular expression library. | 49 | * The %regex class wraps the underlying Unicode regular expression library. |
292 | 50 | */ | 50 | */ |
294 | 51 | class ZORBA_DLL_PUBLIC regex { | 51 | class regex { |
295 | 52 | public: | 52 | public: |
296 | 53 | /** | 53 | /** |
297 | 54 | * Constructs a %regex. | 54 | * Constructs a %regex. |
298 | @@ -520,7 +520,7 @@ | |||
299 | 520 | /** | 520 | /** |
300 | 521 | * The %regex class wraps the underlying Unicode regular expression library. | 521 | * The %regex class wraps the underlying Unicode regular expression library. |
301 | 522 | */ | 522 | */ |
303 | 523 | class ZORBA_DLL_PUBLIC regex { | 523 | class regex { |
304 | 524 | public: | 524 | public: |
305 | 525 | /** | 525 | /** |
306 | 526 | * Constructs a %regex. | 526 | * Constructs a %regex. |
307 | 527 | 527 | ||
308 | === modified file 'src/util/regex_ascii.h' | |||
309 | --- src/util/regex_ascii.h 2011-07-18 14:25:21 +0000 | |||
310 | +++ src/util/regex_ascii.h 2012-01-19 09:11:24 +0000 | |||
311 | @@ -20,8 +20,6 @@ | |||
312 | 20 | #include <list> | 20 | #include <list> |
313 | 21 | #include <vector> | 21 | #include <vector> |
314 | 22 | 22 | ||
315 | 23 | #include <zorba/config.h> | ||
316 | 24 | |||
317 | 25 | namespace zorba { | 23 | namespace zorba { |
318 | 26 | namespace regex_ascii{ | 24 | namespace regex_ascii{ |
319 | 27 | 25 | ||
320 | 28 | 26 | ||
321 | === modified file 'src/util/string_util.h' | |||
322 | --- src/util/string_util.h 2012-01-11 17:30:25 +0000 | |||
323 | +++ src/util/string_util.h 2012-01-19 09:11:24 +0000 | |||
324 | @@ -561,7 +561,6 @@ | |||
325 | 561 | * sufficient size. | 561 | * sufficient size. |
326 | 562 | * @return Returns \a buf for convenience. | 562 | * @return Returns \a buf for convenience. |
327 | 563 | */ | 563 | */ |
328 | 564 | ZORBA_DLL_PUBLIC | ||
329 | 565 | char* itoa( long long n, char *buf ); | 564 | char* itoa( long long n, char *buf ); |
330 | 566 | 565 | ||
331 | 567 | /** | 566 | /** |
332 | @@ -632,7 +631,6 @@ | |||
333 | 632 | * sufficient size. | 631 | * sufficient size. |
334 | 633 | * @return Returns \a buf for convenience. | 632 | * @return Returns \a buf for convenience. |
335 | 634 | */ | 633 | */ |
336 | 635 | ZORBA_DLL_PUBLIC | ||
337 | 636 | char* itoa( unsigned long long n, char *buf ); | 634 | char* itoa( unsigned long long n, char *buf ); |
338 | 637 | 635 | ||
339 | 638 | /** | 636 | /** |
340 | 639 | 637 | ||
341 | === modified file 'src/util/unicode_util.h' | |||
342 | --- src/util/unicode_util.h 2011-12-21 14:40:33 +0000 | |||
343 | +++ src/util/unicode_util.h 2012-01-19 09:11:24 +0000 | |||
344 | @@ -78,7 +78,6 @@ | |||
345 | 78 | * @return Returns \c true only if the character is invalid in an IRI. | 78 | * @return Returns \c true only if the character is invalid in an IRI. |
346 | 79 | * See RFC 3987. | 79 | * See RFC 3987. |
347 | 80 | */ | 80 | */ |
348 | 81 | ZORBA_DLL_PUBLIC | ||
349 | 82 | bool is_invalid_in_iri( code_point c ); | 81 | bool is_invalid_in_iri( code_point c ); |
350 | 83 | 82 | ||
351 | 84 | /** | 83 | /** |
352 | @@ -88,7 +87,6 @@ | |||
353 | 88 | * @return Returns \c true only if the character is a "iprivate". | 87 | * @return Returns \c true only if the character is a "iprivate". |
354 | 89 | * See RFC 3987. | 88 | * See RFC 3987. |
355 | 90 | */ | 89 | */ |
356 | 91 | ZORBA_DLL_PUBLIC | ||
357 | 92 | bool is_iprivate( code_point c ); | 90 | bool is_iprivate( code_point c ); |
358 | 93 | 91 | ||
359 | 94 | /** | 92 | /** |
360 | @@ -114,7 +112,6 @@ | |||
361 | 114 | * @return Returns \c true only if the character is a "ucschar". | 112 | * @return Returns \c true only if the character is a "ucschar". |
362 | 115 | * See RFC 3987. | 113 | * See RFC 3987. |
363 | 116 | */ | 114 | */ |
364 | 117 | ZORBA_DLL_PUBLIC | ||
365 | 118 | bool is_ucschar( code_point c ); | 115 | bool is_ucschar( code_point c ); |
366 | 119 | 116 | ||
367 | 120 | /** | 117 | /** |
368 | @@ -138,7 +135,6 @@ | |||
369 | 138 | * @param c The character. | 135 | * @param c The character. |
370 | 139 | * @return Returns \c true only if the character is lower-case. | 136 | * @return Returns \c true only if the character is lower-case. |
371 | 140 | */ | 137 | */ |
372 | 141 | ZORBA_DLL_PUBLIC | ||
373 | 142 | bool is_lower( code_point c ); | 138 | bool is_lower( code_point c ); |
374 | 143 | 139 | ||
375 | 144 | /** | 140 | /** |
376 | @@ -147,7 +143,6 @@ | |||
377 | 147 | * @param c The character. | 143 | * @param c The character. |
378 | 148 | * @return Returns \c true only if the character is upper-case. | 144 | * @return Returns \c true only if the character is upper-case. |
379 | 149 | */ | 145 | */ |
380 | 150 | ZORBA_DLL_PUBLIC | ||
381 | 151 | bool is_upper( code_point c ); | 146 | bool is_upper( code_point c ); |
382 | 152 | 147 | ||
383 | 153 | /** | 148 | /** |
384 | @@ -157,7 +152,6 @@ | |||
385 | 157 | * @return Returns the given character converted to lower-case or the original | 152 | * @return Returns the given character converted to lower-case or the original |
386 | 158 | * character if either it was already lower-case or not a letter. | 153 | * character if either it was already lower-case or not a letter. |
387 | 159 | */ | 154 | */ |
388 | 160 | ZORBA_DLL_PUBLIC | ||
389 | 161 | code_point to_lower( code_point c ); | 155 | code_point to_lower( code_point c ); |
390 | 162 | 156 | ||
391 | 163 | /** | 157 | /** |
392 | @@ -167,7 +161,6 @@ | |||
393 | 167 | * @return Returns the given character converted to upper-case or the original | 161 | * @return Returns the given character converted to upper-case or the original |
394 | 168 | * character if either it was already upper-case or not a letter. | 162 | * character if either it was already upper-case or not a letter. |
395 | 169 | */ | 163 | */ |
396 | 170 | ZORBA_DLL_PUBLIC | ||
397 | 171 | code_point to_upper( code_point c ); | 164 | code_point to_upper( code_point c ); |
398 | 172 | 165 | ||
399 | 173 | ////////// normalization ////////////////////////////////////////////////////// | 166 | ////////// normalization ////////////////////////////////////////////////////// |
400 | @@ -179,7 +172,6 @@ | |||
401 | 179 | * @param out The normalized string. It is overwritten. | 172 | * @param out The normalized string. It is overwritten. |
402 | 180 | * @return Returns \c true only if the normalization succeeded. | 173 | * @return Returns \c true only if the normalization succeeded. |
403 | 181 | */ | 174 | */ |
404 | 182 | ZORBA_DLL_PUBLIC | ||
405 | 183 | bool normalize( string const &in, normalization::type n, string *out ); | 175 | bool normalize( string const &in, normalization::type n, string *out ); |
406 | 184 | 176 | ||
407 | 185 | ////////// string conversion ////////////////////////////////////////////////// | 177 | ////////// string conversion ////////////////////////////////////////////////// |
408 | @@ -214,7 +206,6 @@ | |||
409 | 214 | * @param out The Unicode string result. | 206 | * @param out The Unicode string result. |
410 | 215 | * @return Returns \c true only if the conversion succeeded. | 207 | * @return Returns \c true only if the conversion succeeded. |
411 | 216 | */ | 208 | */ |
412 | 217 | ZORBA_DLL_PUBLIC | ||
413 | 218 | bool to_string( char const *in, size_type in_len, string *out ); | 209 | bool to_string( char const *in, size_type in_len, string *out ); |
414 | 219 | 210 | ||
415 | 220 | /** | 211 | /** |
416 | 221 | 212 | ||
417 | === modified file 'src/util/uri_util.h' | |||
418 | --- src/util/uri_util.h 2011-07-17 20:05:49 +0000 | |||
419 | +++ src/util/uri_util.h 2012-01-19 09:11:24 +0000 | |||
420 | @@ -80,8 +80,8 @@ | |||
421 | 80 | 80 | ||
422 | 81 | ////////// Encoding /////////////////////////////////////////////////////////// | 81 | ////////// Encoding /////////////////////////////////////////////////////////// |
423 | 82 | 82 | ||
426 | 83 | ZORBA_DLL_PUBLIC extern char const uri_safe[]; | 83 | extern char const uri_safe[]; |
427 | 84 | ZORBA_DLL_PUBLIC extern signed char const hex2dec[]; | 84 | extern signed char const hex2dec[]; |
428 | 85 | 85 | ||
429 | 86 | /** | 86 | /** |
430 | 87 | * A %back_insert_iterator can be used to append characters to a string | 87 | * A %back_insert_iterator can be used to append characters to a string |
431 | 88 | 88 | ||
432 | === modified file 'src/util/utf8_util.h' | |||
433 | --- src/util/utf8_util.h 2011-07-17 20:05:49 +0000 | |||
434 | +++ src/util/utf8_util.h 2012-01-19 09:11:24 +0000 | |||
435 | @@ -21,8 +21,6 @@ | |||
436 | 21 | #include <cwchar> | 21 | #include <cwchar> |
437 | 22 | #include <string> | 22 | #include <string> |
438 | 23 | 23 | ||
439 | 24 | #include <zorba/config.h> | ||
440 | 25 | |||
441 | 26 | #include "ascii_util.h" | 24 | #include "ascii_util.h" |
442 | 27 | #include "cxx_util.h" | 25 | #include "cxx_util.h" |
443 | 28 | #include "unicode_util.h" | 26 | #include "unicode_util.h" |
444 | @@ -319,7 +317,6 @@ | |||
445 | 319 | * the UTF-8 string are put here. | 317 | * the UTF-8 string are put here. |
446 | 320 | * @return Returns \c true only if the conversion succeeded. | 318 | * @return Returns \c true only if the conversion succeeded. |
447 | 321 | */ | 319 | */ |
448 | 322 | ZORBA_DLL_PUBLIC | ||
449 | 323 | bool to_string( unicode::char_type const *in, unicode::size_type in_len, | 320 | bool to_string( unicode::char_type const *in, unicode::size_type in_len, |
450 | 324 | storage_type **out, size_type *out_len = nullptr ); | 321 | storage_type **out, size_type *out_len = nullptr ); |
451 | 325 | 322 | ||
452 | @@ -406,7 +403,6 @@ | |||
453 | 406 | * the UTF-8 string are put here. | 403 | * the UTF-8 string are put here. |
454 | 407 | * @return Returns \c true only if the conversion succeeded. | 404 | * @return Returns \c true only if the conversion succeeded. |
455 | 408 | */ | 405 | */ |
456 | 409 | ZORBA_DLL_PUBLIC | ||
457 | 410 | bool to_string( wchar_t const *in, size_type in_len, storage_type **out, | 406 | bool to_string( wchar_t const *in, size_type in_len, storage_type **out, |
458 | 411 | size_type *out_len = nullptr ); | 407 | size_type *out_len = nullptr ); |
459 | 412 | 408 | ||
460 | @@ -476,7 +472,6 @@ | |||
461 | 476 | * the wchar_t string are put here. | 472 | * the wchar_t string are put here. |
462 | 477 | * @return Returns \c true only if the conversion succeeded. | 473 | * @return Returns \c true only if the conversion succeeded. |
463 | 478 | */ | 474 | */ |
464 | 479 | ZORBA_DLL_PUBLIC | ||
465 | 480 | bool to_wchar_t( storage_type const *in, size_type in_len, wchar_t **out, | 475 | bool to_wchar_t( storage_type const *in, size_type in_len, wchar_t **out, |
466 | 481 | unicode::size_type *out_len ); | 476 | unicode::size_type *out_len ); |
467 | 482 | 477 | ||
468 | 483 | 478 | ||
469 | === modified file 'src/util/utf8_util_base.h' | |||
470 | --- src/util/utf8_util_base.h 2011-12-21 14:40:33 +0000 | |||
471 | +++ src/util/utf8_util_base.h 2012-01-19 09:11:24 +0000 | |||
472 | @@ -22,8 +22,6 @@ | |||
473 | 22 | #include <iterator> | 22 | #include <iterator> |
474 | 23 | #include <stdexcept> | 23 | #include <stdexcept> |
475 | 24 | 24 | ||
476 | 25 | #include <zorba/config.h> | ||
477 | 26 | |||
478 | 27 | #include "unicode_util.h" | 25 | #include "unicode_util.h" |
479 | 28 | 26 | ||
480 | 29 | namespace zorba { | 27 | namespace zorba { |
481 | @@ -63,7 +61,6 @@ | |||
482 | 63 | * @param char_pos The character position. | 61 | * @param char_pos The character position. |
483 | 64 | * @return Returns the corresponding byte position. | 62 | * @return Returns the corresponding byte position. |
484 | 65 | */ | 63 | */ |
485 | 66 | ZORBA_DLL_PUBLIC | ||
486 | 67 | size_type byte_pos( storage_type const *s, size_type char_pos ); | 64 | size_type byte_pos( storage_type const *s, size_type char_pos ); |
487 | 68 | 65 | ||
488 | 69 | /** | 66 | /** |
489 | @@ -75,7 +72,6 @@ | |||
490 | 75 | * @return Returns the corresponding byte position or \c npos if the result >= | 72 | * @return Returns the corresponding byte position or \c npos if the result >= |
491 | 76 | * \a s_size. | 73 | * \a s_size. |
492 | 77 | */ | 74 | */ |
493 | 78 | ZORBA_DLL_PUBLIC | ||
494 | 79 | size_type byte_pos( storage_type const *s, size_type s_size, | 75 | size_type byte_pos( storage_type const *s, size_type s_size, |
495 | 80 | size_type char_pos ); | 76 | size_type char_pos ); |
496 | 81 | 77 | ||
497 | @@ -86,7 +82,6 @@ | |||
498 | 86 | * @param p A pointer to somewhere within \a s. | 82 | * @param p A pointer to somewhere within \a s. |
499 | 87 | * @return Returns said offset. | 83 | * @return Returns said offset. |
500 | 88 | */ | 84 | */ |
501 | 89 | ZORBA_DLL_PUBLIC | ||
502 | 90 | size_type char_pos( storage_type const *s, storage_type const *p ); | 85 | size_type char_pos( storage_type const *s, storage_type const *p ); |
503 | 91 | 86 | ||
504 | 92 | /** | 87 | /** |
505 | @@ -111,7 +106,6 @@ | |||
506 | 111 | * character. | 106 | * character. |
507 | 112 | * @return Returns the number of bytes required to encode the character. | 107 | * @return Returns the number of bytes required to encode the character. |
508 | 113 | */ | 108 | */ |
509 | 114 | ZORBA_DLL_PUBLIC | ||
510 | 115 | size_type encode( unicode::code_point c, storage_type **ps ); | 109 | size_type encode( unicode::code_point c, storage_type **ps ); |
511 | 116 | 110 | ||
512 | 117 | /** | 111 | /** |
513 | @@ -149,7 +143,6 @@ | |||
514 | 149 | * @return Returns the Unicode code-point of the next character. | 143 | * @return Returns the Unicode code-point of the next character. |
515 | 150 | */ | 144 | */ |
516 | 151 | template<class OctetIterator> | 145 | template<class OctetIterator> |
517 | 152 | ZORBA_DLL_PUBLIC | ||
518 | 153 | unicode::code_point next_char( OctetIterator &i ); | 146 | unicode::code_point next_char( OctetIterator &i ); |
519 | 154 | 147 | ||
520 | 155 | /** | 148 | /** |
521 | @@ -234,7 +227,6 @@ | |||
522 | 234 | * @return Returns a number in the range [1,6] if \a start is valid or 0 if | 227 | * @return Returns a number in the range [1,6] if \a start is valid or 0 if |
523 | 235 | * \a start is invalid. | 228 | * \a start is invalid. |
524 | 236 | */ | 229 | */ |
525 | 237 | ZORBA_DLL_PUBLIC | ||
526 | 238 | size_type char_length( storage_type start ); | 230 | size_type char_length( storage_type start ); |
527 | 239 | 231 | ||
528 | 240 | /** | 232 | /** |
529 | @@ -244,7 +236,6 @@ | |||
530 | 244 | * @param s A pointer to the first byte of a NULL-terminated UTF-8 string. | 236 | * @param s A pointer to the first byte of a NULL-terminated UTF-8 string. |
531 | 245 | * @return Returns said number of characters. | 237 | * @return Returns said number of characters. |
532 | 246 | */ | 238 | */ |
533 | 247 | ZORBA_DLL_PUBLIC | ||
534 | 248 | size_type length( storage_type const *s ); | 239 | size_type length( storage_type const *s ); |
535 | 249 | 240 | ||
536 | 250 | /** | 241 | /** |
537 | @@ -256,7 +247,6 @@ | |||
538 | 256 | * sequence. | 247 | * sequence. |
539 | 257 | * @return Returns said number of characters. | 248 | * @return Returns said number of characters. |
540 | 258 | */ | 249 | */ |
541 | 259 | ZORBA_DLL_PUBLIC | ||
542 | 260 | size_type length( storage_type const *begin, storage_type const *end ); | 250 | size_type length( storage_type const *begin, storage_type const *end ); |
543 | 261 | 251 | ||
544 | 262 | /** | 252 | /** |
545 | @@ -321,7 +311,6 @@ | |||
546 | 321 | * @return Returns \c nullptr if the string is valid or a pointer to the first | 311 | * @return Returns \c nullptr if the string is valid or a pointer to the first |
547 | 322 | * invalid byte if invalid. | 312 | * invalid byte if invalid. |
548 | 323 | */ | 313 | */ |
549 | 324 | ZORBA_DLL_PUBLIC | ||
550 | 325 | storage_type const* validate( storage_type const *s ); | 314 | storage_type const* validate( storage_type const *s ); |
551 | 326 | 315 | ||
552 | 327 | /** | 316 | /** |
553 | @@ -332,7 +321,6 @@ | |||
554 | 332 | * @return Returns \c nullptr if the string is valid or a pointer to the first | 321 | * @return Returns \c nullptr if the string is valid or a pointer to the first |
555 | 333 | * invalid byte if invalid. | 322 | * invalid byte if invalid. |
556 | 334 | */ | 323 | */ |
557 | 335 | ZORBA_DLL_PUBLIC | ||
558 | 336 | storage_type const* validate( storage_type const *s, size_type s_size ); | 324 | storage_type const* validate( storage_type const *s, size_type s_size ); |
559 | 337 | 325 | ||
560 | 338 | ////////// iterator /////////////////////////////////////////////////////////// | 326 | ////////// iterator /////////////////////////////////////////////////////////// |
561 | 339 | 327 | ||
562 | === modified file 'src/util/xml_util.h' | |||
563 | --- src/util/xml_util.h 2011-06-16 15:12:30 +0000 | |||
564 | +++ src/util/xml_util.h 2012-01-19 09:11:24 +0000 | |||
565 | @@ -191,7 +191,6 @@ | |||
566 | 191 | * @return If successful, returns the number of characters parsed; otherwise | 191 | * @return If successful, returns the number of characters parsed; otherwise |
567 | 192 | * returns -1. | 192 | * returns -1. |
568 | 193 | */ | 193 | */ |
569 | 194 | ZORBA_DLL_PUBLIC | ||
570 | 195 | int parse_entity( char const *ref, unicode::code_point *c ); | 194 | int parse_entity( char const *ref, unicode::code_point *c ); |
571 | 196 | 195 | ||
572 | 197 | /** | 196 | /** |
573 | 198 | 197 | ||
574 | === modified file 'test/unit/CMakeLists.txt' | |||
575 | --- test/unit/CMakeLists.txt 2012-01-11 17:30:25 +0000 | |||
576 | +++ test/unit/CMakeLists.txt 2012-01-19 09:11:24 +0000 | |||
577 | @@ -83,10 +83,7 @@ | |||
578 | 83 | ext_in_opt.cpp | 83 | ext_in_opt.cpp |
579 | 84 | collection.cpp | 84 | collection.cpp |
580 | 85 | test_audit.cpp | 85 | test_audit.cpp |
581 | 86 | string_instantiate.cpp | ||
582 | 87 | streamable_string.cpp | 86 | streamable_string.cpp |
583 | 88 | string_test.cpp | ||
584 | 89 | unique_ptr.cpp | ||
585 | 90 | main_sequential.cpp | 87 | main_sequential.cpp |
586 | 91 | context_item.cpp | 88 | context_item.cpp |
587 | 92 | datetime.cpp | 89 | datetime.cpp |
588 | @@ -96,13 +93,6 @@ | |||
589 | 96 | staticcollectionmanager.cpp | 93 | staticcollectionmanager.cpp |
590 | 97 | ) | 94 | ) |
591 | 98 | 95 | ||
592 | 99 | IF (NOT ZORBA_NO_FULL_TEXT) | ||
593 | 100 | LIST(APPEND UNIT_TESTS_SRCS | ||
594 | 101 | stemmer.cpp | ||
595 | 102 | thesaurus.cpp | ||
596 | 103 | tokenizer.cpp) | ||
597 | 104 | ENDIF (NOT ZORBA_NO_FULL_TEXT) | ||
598 | 105 | |||
599 | 106 | # multithread_simple.cpp | 96 | # multithread_simple.cpp |
600 | 107 | # multithread_stress_test.cpp | 97 | # multithread_stress_test.cpp |
601 | 108 | 98 | ||
602 | @@ -140,5 +130,14 @@ | |||
603 | 140 | ZORBA_GENERATE_EXE(LibUnitTest lib_unit_test.cpp "" "" "") | 130 | ZORBA_GENERATE_EXE(LibUnitTest lib_unit_test.cpp "" "" "") |
604 | 141 | 131 | ||
605 | 142 | # ADD NEW UNIT TESTS HERE | 132 | # ADD NEW UNIT TESTS HERE |
606 | 133 | ZORBA_ADD_TEST("test/libunit/string" LibUnitTest string) | ||
607 | 143 | ZORBA_ADD_TEST("test/libunit/uri" LibUnitTest uri) | 134 | ZORBA_ADD_TEST("test/libunit/uri" LibUnitTest uri) |
608 | 144 | EXPECTED_FAILURE(test/libunit/uri 3118348) | 135 | EXPECTED_FAILURE(test/libunit/uri 3118348) |
609 | 136 | ZORBA_ADD_TEST("test/libunit/unique_ptr" LibUnitTest unique_ptr) | ||
610 | 137 | IF (NOT ZORBA_NO_FULL_TEXT) | ||
611 | 138 | ZORBA_ADD_TEST("test/libunit/stemmer" LibUnitTest stemmer) | ||
612 | 139 | ZORBA_ADD_TEST("test/libunit/thesaurus" LibUnitTest thesaurus) | ||
613 | 140 | ZORBA_ADD_TEST("test/libunit/tokenizer" LibUnitTest tokenizer) | ||
614 | 141 | ENDIF (NOT ZORBA_NO_FULL_TEXT) | ||
615 | 142 | |||
616 | 143 | # vim:set et sw=2 ts=2: |
Should we merge these changes?