Merge lp:~zorba-coders/zorba/bug-896426 into lp:zorba

Proposed by Paul J. Lucas
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
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.

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Should we merge these changes?

review: Needs Information
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

It's not critical. I was hoping that Chris would have migrated more unit tests.

Revision history for this message
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).

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

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

text conflict in src/unit_tests/CMakeLists.txt

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:~zorba-coders/zorba/bug-896426 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job bug-896426-2012-01-19T09-25-58.981Z is finished. The
  final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

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

Revision history for this message
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.

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-896426-2012-01-19T10-12-03.231Z 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. Got: 1 Needs Information, 1 Pending.

Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) :
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-896426-2012-01-27T07-38-56.145Z is finished. The final status was:

All tests succeeded!

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/unit_tests/CMakeLists.txt'
--- src/unit_tests/CMakeLists.txt 2011-12-21 14:40:33 +0000
+++ src/unit_tests/CMakeLists.txt 2012-01-19 09:11:24 +0000
@@ -14,6 +14,24 @@
14 14
1515
16SET(UNIT_TEST_SRCS16SET(UNIT_TEST_SRCS
17 string_instantiate.cpp
18 string.cpp
19 test_uri.cpp
20 unique_ptr.cpp
17 unit_tests.cpp21 unit_tests.cpp
18 test_uri.cpp
19)22)
23
24IF (NOT ZORBA_NO_FULL_TEXT)
25 LIST (APPEND UNIT_TEST_SRCS
26 stemmer.cpp
27 thesaurus.cpp
28 tokenizer.cpp)
29ENDIF (NOT ZORBA_NO_FULL_TEXT)
30
31IF(ZORBA_WITH_DEBUGGER)
32 LIST(APPEND UNIT_TEST_SRCS
33# test_debugger_protocol.cpp
34 )
35ENDIF(ZORBA_WITH_DEBUGGER)
36
37# vim:set et sw=2 tw=2:
2038
=== renamed file 'test/unit/stemmer.cpp' => 'src/unit_tests/stemmer.cpp'
--- test/unit/stemmer.cpp 2011-08-25 15:54:19 +0000
+++ src/unit_tests/stemmer.cpp 2012-01-19 09:11:24 +0000
@@ -74,7 +74,10 @@
7474
75///////////////////////////////////////////////////////////////////////////////75///////////////////////////////////////////////////////////////////////////////
7676
77int stemmer( int argc, char *argv[] ) {77namespace zorba {
78namespace UnitTests {
79
80int test_stemmer( int argc, char *argv[] ) {
78 void *const zstore = StoreManager::getStore();81 void *const zstore = StoreManager::getStore();
79 Zorba *const zorba = Zorba::getInstance( zstore );82 Zorba *const zorba = Zorba::getInstance( zstore );
8083
@@ -113,4 +116,8 @@
113 StoreManager::shutdownStore( zstore );116 StoreManager::shutdownStore( zstore );
114 return result;117 return result;
115}118}
119
120} // namespace UnitTests
121} // namespace zorba
122
116/* vim:set et sw=2 ts=2: */123/* vim:set et sw=2 ts=2: */
117124
=== renamed file 'test/unit/string_test.cpp' => 'src/unit_tests/string.cpp'
--- test/unit/string_test.cpp 2011-08-24 12:48:09 +0000
+++ src/unit_tests/string.cpp 2012-01-19 09:11:24 +0000
@@ -778,7 +778,12 @@
778 ASSERT_TRUE( xml::parse_entity( "&#x26", &c ) == -1 );778 ASSERT_TRUE( xml::parse_entity( "&#x26", &c ) == -1 );
779}779}
780780
781int string_test( int, char*[] ) {781///////////////////////////////////////////////////////////////////////////////
782
783namespace zorba {
784namespace UnitTests {
785
786int test_string( int, char*[] ) {
782787
783 ////////// basic string functionality ///////////////////////////////////////788 ////////// basic string functionality ///////////////////////////////////////
784789
@@ -898,4 +903,8 @@
898 cout << failures << " test(s) failed\n";903 cout << failures << " test(s) failed\n";
899 return failures ? 1 : 0;904 return failures ? 1 : 0;
900}905}
906
907} // namespace UnitTests
908} // namespace zorba
909
901/* vim:set et sw=2 ts=2: */910/* vim:set et sw=2 ts=2: */
902911
=== renamed file 'test/unit/string_instantiate.cpp' => 'src/unit_tests/string_instantiate.cpp'
--- test/unit/string_instantiate.cpp 2011-06-14 17:26:33 +0000
+++ src/unit_tests/string_instantiate.cpp 2012-01-19 09:11:24 +0000
@@ -547,7 +547,10 @@
547547
548///////////////////////////////////////////////////////////////////////////////548///////////////////////////////////////////////////////////////////////////////
549549
550int string_instantiate( int, char*[] ) {550namespace zorba {
551namespace UnitTests {
552
553int test_string_instantiate( int, char*[] ) {
551 return 0; // don't actually call anything554 return 0; // don't actually call anything
552555
553 instantiate_common<zstring>();556 instantiate_common<zstring>();
@@ -570,4 +573,8 @@
570573
571 return 0;574 return 0;
572}575}
576
577} // namespace UnitTests
578} // namespace zorba
579
573/* vim:set et sw=2 ts=2: */580/* vim:set et sw=2 ts=2: */
574581
=== renamed file 'test/unit/thesaurus.cpp' => 'src/unit_tests/thesaurus.cpp'
--- test/unit/thesaurus.cpp 2011-10-24 23:26:11 +0000
+++ src/unit_tests/thesaurus.cpp 2012-01-19 09:11:24 +0000
@@ -118,7 +118,10 @@
118118
119///////////////////////////////////////////////////////////////////////////////119///////////////////////////////////////////////////////////////////////////////
120120
121int thesaurus( int argc, char *argv[] ) {121namespace zorba {
122namespace UnitTests {
123
124int test_thesaurus( int argc, char *argv[] ) {
122 void *const zstore = StoreManager::getStore();125 void *const zstore = StoreManager::getStore();
123 Zorba *const zorba = Zorba::getInstance( zstore );126 Zorba *const zorba = Zorba::getInstance( zstore );
124127
@@ -157,4 +160,8 @@
157 StoreManager::shutdownStore( zstore );160 StoreManager::shutdownStore( zstore );
158 return result;161 return result;
159}162}
163
164} // namespace UnitTests
165} // namespace zorba
166
160/* vim:set et sw=2 ts=2: */167/* vim:set et sw=2 ts=2: */
161168
=== renamed file 'test/unit/tokenizer.cpp' => 'src/unit_tests/tokenizer.cpp'
--- test/unit/tokenizer.cpp 2011-08-31 01:59:30 +0000
+++ src/unit_tests/tokenizer.cpp 2012-01-19 09:11:24 +0000
@@ -341,7 +341,10 @@
341341
342///////////////////////////////////////////////////////////////////////////////342///////////////////////////////////////////////////////////////////////////////
343343
344int tokenizer( int argc, char *argv[] ) {344namespace zorba {
345namespace UnitTests {
346
347int test_tokenizer( int argc, char *argv[] ) {
345 int result = 0;348 int result = 0;
346349
347 void *const zstore = StoreManager::getStore();350 void *const zstore = StoreManager::getStore();
@@ -389,4 +392,8 @@
389 StoreManager::shutdownStore( zstore );392 StoreManager::shutdownStore( zstore );
390 return result;393 return result;
391}394}
395
396} // namespace UnitTests
397} // namespace zorba
398
392/* vim:set et sw=2 ts=2: */399/* vim:set et sw=2 ts=2: */
393400
=== renamed file 'test/unit/unique_ptr.cpp' => 'src/unit_tests/unique_ptr.cpp'
--- test/unit/unique_ptr.cpp 2011-08-27 14:57:52 +0000
+++ src/unit_tests/unique_ptr.cpp 2012-01-19 09:11:24 +0000
@@ -221,7 +221,10 @@
221221
222///////////////////////////////////////////////////////////////////////////////222///////////////////////////////////////////////////////////////////////////////
223223
224int unique_ptr( int, char*[] ) {224namespace zorba {
225namespace UnitTests {
226
227int test_unique_ptr( int, char*[] ) {
225 compile_test();228 compile_test();
226 test_array();229 test_array();
227 test_basic();230 test_basic();
@@ -239,6 +242,9 @@
239 return failures ? 1 : 0;242 return failures ? 1 : 0;
240}243}
241244
245} // namespace UnitTests
246} // namespace zorba
247
242///////////////////////////////////////////////////////////////////////////////248///////////////////////////////////////////////////////////////////////////////
243249
244/* vim:set et sw=2 ts=2: */250/* vim:set et sw=2 ts=2: */
245251
=== modified file 'src/unit_tests/unit_test_list.h'
--- src/unit_tests/unit_test_list.h 2011-06-14 17:26:33 +0000
+++ src/unit_tests/unit_test_list.h 2012-01-19 09:11:24 +0000
@@ -17,19 +17,24 @@
17#ifndef ZORBA_UNIT_TEST_LIST_H17#ifndef ZORBA_UNIT_TEST_LIST_H
18#define ZORBA_UNIT_TEST_LIST_H18#define ZORBA_UNIT_TEST_LIST_H
1919
20#include <iostream>20#include <zorba/config.h>
21
2221
23namespace zorba {22namespace zorba {
2423
25 namespace UnitTests {24 namespace UnitTests {
26 int runUriTest(int argc, char* argv[]);25 int runUriTest(int argc, char* argv[]);
27 int runDebuggerProtocolTest(int argc, char* argv[]);26 int runDebuggerProtocolTest(int argc, char* argv[]);
27 int test_string( int, char*[] );
28 int test_unique_ptr( int, char*[] );
29#ifndef ZORBA_NO_FULL_TEXT
30 int test_stemmer( int, char*[] );
31 int test_thesaurus( int, char*[] );
32 int test_tokenizer( int, char*[] );
33#endif /* ZORBA_NO_FULL_TEXT */
28 /**34 /**
29 * ADD NEW UNIT TESTS HERE35 * ADD NEW UNIT TESTS HERE
30 */36 */
3137
32
33 void initializeTestList();38 void initializeTestList();
34 };39 };
35 40
3641
=== modified file 'src/unit_tests/unit_tests.cpp'
--- src/unit_tests/unit_tests.cpp 2011-06-14 17:26:33 +0000
+++ src/unit_tests/unit_tests.cpp 2012-01-19 09:11:24 +0000
@@ -37,10 +37,18 @@
37 * ADD NEW UNIT TESTS HERE37 * ADD NEW UNIT TESTS HERE
38 */38 */
39 void initializeTestList() {39 void initializeTestList() {
40 libunittests["string"] = test_string;
40 libunittests["uri"] = runUriTest;41 libunittests["uri"] = runUriTest;
42 libunittests["unique_ptr"] = test_unique_ptr;
43#ifndef ZORBA_NO_FULL_TEXT
44 libunittests["stemmer"] = test_stemmer;
45 libunittests["thesaurus"] = test_thesaurus;
46 libunittests["tokenizer"] = test_tokenizer;
47#endif /* ZORBA_NO_FULL_TEXT */
48
41#ifdef ZORBA_WITH_DEBUGGER49#ifdef ZORBA_WITH_DEBUGGER
42// libunittests["debugger_protocol"] = runDebuggerProtocolTest;50// libunittests["debugger_protocol"] = runDebuggerProtocolTest;
43#endif51#endif /* ZORBA_WITH_DEBUGGER */
44 }52 }
4553
46 int runUnitTest(int argc, char* argv[]) {54 int runUnitTest(int argc, char* argv[]) {
4755
=== modified file 'src/util/ascii_util.h'
--- src/util/ascii_util.h 2011-06-19 16:17:46 +0000
+++ src/util/ascii_util.h 2012-01-19 09:11:24 +0000
@@ -22,8 +22,6 @@
22#include <cstddef>22#include <cstddef>
23#include <cstring>23#include <cstring>
2424
25#include <zorba/config.h>
26
27#include "stl_util.h"25#include "stl_util.h"
2826
29namespace zorba {27namespace zorba {
@@ -205,7 +203,7 @@
205 * @param s The NULL-terminated C string to check.203 * @param s The NULL-terminated C string to check.
206 * @return Returns \c true only if the entire string is whitespace.204 * @return Returns \c true only if the entire string is whitespace.
207 */205 */
208ZORBA_DLL_PUBLIC bool is_whitespace( char const *s );206bool is_whitespace( char const *s );
209207
210/**208/**
211 * Checks whether an entire string is whitespace.209 * Checks whether an entire string is whitespace.
@@ -684,7 +682,6 @@
684 * @return Returns a pointer to the first character in \a s that is not among682 * @return Returns a pointer to the first character in \a s that is not among
685 * the characters in \a chars.683 * the characters in \a chars.
686 */684 */
687ZORBA_DLL_PUBLIC
688char const* trim_start( char const *s, char const *chars );685char const* trim_start( char const *s, char const *chars );
689686
690/**687/**
@@ -696,7 +693,6 @@
696 * @return Returns a pointer to the first character in \a s that is not among693 * @return Returns a pointer to the first character in \a s that is not among
697 * the characters in \a chars.694 * the characters in \a chars.
698 */695 */
699ZORBA_DLL_PUBLIC
700char const* trim_start( char const *s, size_type s_len, char const *chars );696char const* trim_start( char const *s, size_type s_len, char const *chars );
701697
702/**698/**
@@ -782,7 +778,6 @@
782 * @param chars The characters to trim.778 * @param chars The characters to trim.
783 * @return Returns the new length of \a s.779 * @return Returns the new length of \a s.
784 */780 */
785ZORBA_DLL_PUBLIC
786size_type trim_end( char const *s, size_type s_len, char const *chars );781size_type trim_end( char const *s, size_type s_len, char const *chars );
787782
788/**783/**
789784
=== modified file 'src/util/regex.h'
--- src/util/regex.h 2011-07-18 14:25:21 +0000
+++ src/util/regex.h 2012-01-19 09:11:24 +0000
@@ -48,7 +48,7 @@
48/**48/**
49 * The %regex class wraps the underlying Unicode regular expression library.49 * The %regex class wraps the underlying Unicode regular expression library.
50 */50 */
51class ZORBA_DLL_PUBLIC regex {51class regex {
52public:52public:
53 /**53 /**
54 * Constructs a %regex.54 * Constructs a %regex.
@@ -520,7 +520,7 @@
520/**520/**
521 * The %regex class wraps the underlying Unicode regular expression library.521 * The %regex class wraps the underlying Unicode regular expression library.
522 */522 */
523class ZORBA_DLL_PUBLIC regex {523class regex {
524public:524public:
525 /**525 /**
526 * Constructs a %regex.526 * Constructs a %regex.
527527
=== modified file 'src/util/regex_ascii.h'
--- src/util/regex_ascii.h 2011-07-18 14:25:21 +0000
+++ src/util/regex_ascii.h 2012-01-19 09:11:24 +0000
@@ -20,8 +20,6 @@
20#include <list>20#include <list>
21#include <vector>21#include <vector>
2222
23#include <zorba/config.h>
24
25namespace zorba {23namespace zorba {
26 namespace regex_ascii{24 namespace regex_ascii{
2725
2826
=== modified file 'src/util/string_util.h'
--- src/util/string_util.h 2012-01-11 17:30:25 +0000
+++ src/util/string_util.h 2012-01-19 09:11:24 +0000
@@ -561,7 +561,6 @@
561 * sufficient size.561 * sufficient size.
562 * @return Returns \a buf for convenience.562 * @return Returns \a buf for convenience.
563 */563 */
564ZORBA_DLL_PUBLIC
565char* itoa( long long n, char *buf );564char* itoa( long long n, char *buf );
566565
567/**566/**
@@ -632,7 +631,6 @@
632 * sufficient size.631 * sufficient size.
633 * @return Returns \a buf for convenience.632 * @return Returns \a buf for convenience.
634 */633 */
635ZORBA_DLL_PUBLIC
636char* itoa( unsigned long long n, char *buf );634char* itoa( unsigned long long n, char *buf );
637635
638/**636/**
639637
=== modified file 'src/util/unicode_util.h'
--- src/util/unicode_util.h 2011-12-21 14:40:33 +0000
+++ src/util/unicode_util.h 2012-01-19 09:11:24 +0000
@@ -78,7 +78,6 @@
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.
79 * See RFC 3987.79 * See RFC 3987.
80 */80 */
81ZORBA_DLL_PUBLIC
82bool is_invalid_in_iri( code_point c );81bool is_invalid_in_iri( code_point c );
8382
84/**83/**
@@ -88,7 +87,6 @@
88 * @return Returns \c true only if the character is a "iprivate".87 * @return Returns \c true only if the character is a "iprivate".
89 * See RFC 3987.88 * See RFC 3987.
90 */89 */
91ZORBA_DLL_PUBLIC
92bool is_iprivate( code_point c );90bool is_iprivate( code_point c );
9391
94/**92/**
@@ -114,7 +112,6 @@
114 * @return Returns \c true only if the character is a "ucschar".112 * @return Returns \c true only if the character is a "ucschar".
115 * See RFC 3987.113 * See RFC 3987.
116 */114 */
117ZORBA_DLL_PUBLIC
118bool is_ucschar( code_point c );115bool is_ucschar( code_point c );
119116
120/**117/**
@@ -138,7 +135,6 @@
138 * @param c The character.135 * @param c The character.
139 * @return Returns \c true only if the character is lower-case.136 * @return Returns \c true only if the character is lower-case.
140 */137 */
141ZORBA_DLL_PUBLIC
142bool is_lower( code_point c );138bool is_lower( code_point c );
143139
144/**140/**
@@ -147,7 +143,6 @@
147 * @param c The character.143 * @param c The character.
148 * @return Returns \c true only if the character is upper-case.144 * @return Returns \c true only if the character is upper-case.
149 */145 */
150ZORBA_DLL_PUBLIC
151bool is_upper( code_point c );146bool is_upper( code_point c );
152147
153/**148/**
@@ -157,7 +152,6 @@
157 * @return Returns the given character converted to lower-case or the original152 * @return Returns the given character converted to lower-case or the original
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.
159 */154 */
160ZORBA_DLL_PUBLIC
161code_point to_lower( code_point c );155code_point to_lower( code_point c );
162156
163/**157/**
@@ -167,7 +161,6 @@
167 * @return Returns the given character converted to upper-case or the original161 * @return Returns the given character converted to upper-case or the original
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.
169 */163 */
170ZORBA_DLL_PUBLIC
171code_point to_upper( code_point c );164code_point to_upper( code_point c );
172165
173////////// normalization //////////////////////////////////////////////////////166////////// normalization //////////////////////////////////////////////////////
@@ -179,7 +172,6 @@
179 * @param out The normalized string. It is overwritten.172 * @param out The normalized string. It is overwritten.
180 * @return Returns \c true only if the normalization succeeded.173 * @return Returns \c true only if the normalization succeeded.
181 */174 */
182ZORBA_DLL_PUBLIC
183bool normalize( string const &in, normalization::type n, string *out );175bool normalize( string const &in, normalization::type n, string *out );
184176
185////////// string conversion //////////////////////////////////////////////////177////////// string conversion //////////////////////////////////////////////////
@@ -214,7 +206,6 @@
214 * @param out The Unicode string result.206 * @param out The Unicode string result.
215 * @return Returns \c true only if the conversion succeeded.207 * @return Returns \c true only if the conversion succeeded.
216 */208 */
217ZORBA_DLL_PUBLIC
218bool to_string( char const *in, size_type in_len, string *out );209bool to_string( char const *in, size_type in_len, string *out );
219210
220/**211/**
221212
=== modified file 'src/util/uri_util.h'
--- src/util/uri_util.h 2011-07-17 20:05:49 +0000
+++ src/util/uri_util.h 2012-01-19 09:11:24 +0000
@@ -80,8 +80,8 @@
8080
81////////// Encoding ///////////////////////////////////////////////////////////81////////// Encoding ///////////////////////////////////////////////////////////
8282
83ZORBA_DLL_PUBLIC extern char const uri_safe[];83extern char const uri_safe[];
84ZORBA_DLL_PUBLIC extern signed char const hex2dec[];84extern signed char const hex2dec[];
8585
86/**86/**
87 * A %back_insert_iterator can be used to append characters to a string87 * A %back_insert_iterator can be used to append characters to a string
8888
=== modified file 'src/util/utf8_util.h'
--- src/util/utf8_util.h 2011-07-17 20:05:49 +0000
+++ src/util/utf8_util.h 2012-01-19 09:11:24 +0000
@@ -21,8 +21,6 @@
21#include <cwchar>21#include <cwchar>
22#include <string>22#include <string>
2323
24#include <zorba/config.h>
25
26#include "ascii_util.h"24#include "ascii_util.h"
27#include "cxx_util.h"25#include "cxx_util.h"
28#include "unicode_util.h"26#include "unicode_util.h"
@@ -319,7 +317,6 @@
319 * the UTF-8 string are put here.317 * the UTF-8 string are put here.
320 * @return Returns \c true only if the conversion succeeded.318 * @return Returns \c true only if the conversion succeeded.
321 */319 */
322ZORBA_DLL_PUBLIC
323bool to_string( unicode::char_type const *in, unicode::size_type in_len,320bool to_string( unicode::char_type const *in, unicode::size_type in_len,
324 storage_type **out, size_type *out_len = nullptr );321 storage_type **out, size_type *out_len = nullptr );
325322
@@ -406,7 +403,6 @@
406 * the UTF-8 string are put here.403 * the UTF-8 string are put here.
407 * @return Returns \c true only if the conversion succeeded.404 * @return Returns \c true only if the conversion succeeded.
408 */405 */
409ZORBA_DLL_PUBLIC
410bool to_string( wchar_t const *in, size_type in_len, storage_type **out,406bool to_string( wchar_t const *in, size_type in_len, storage_type **out,
411 size_type *out_len = nullptr );407 size_type *out_len = nullptr );
412408
@@ -476,7 +472,6 @@
476 * the wchar_t string are put here.472 * the wchar_t string are put here.
477 * @return Returns \c true only if the conversion succeeded.473 * @return Returns \c true only if the conversion succeeded.
478 */474 */
479ZORBA_DLL_PUBLIC
480bool to_wchar_t( storage_type const *in, size_type in_len, wchar_t **out,475bool to_wchar_t( storage_type const *in, size_type in_len, wchar_t **out,
481 unicode::size_type *out_len );476 unicode::size_type *out_len );
482477
483478
=== modified file 'src/util/utf8_util_base.h'
--- src/util/utf8_util_base.h 2011-12-21 14:40:33 +0000
+++ src/util/utf8_util_base.h 2012-01-19 09:11:24 +0000
@@ -22,8 +22,6 @@
22#include <iterator>22#include <iterator>
23#include <stdexcept>23#include <stdexcept>
2424
25#include <zorba/config.h>
26
27#include "unicode_util.h"25#include "unicode_util.h"
2826
29namespace zorba {27namespace zorba {
@@ -63,7 +61,6 @@
63 * @param char_pos The character position.61 * @param char_pos The character position.
64 * @return Returns the corresponding byte position.62 * @return Returns the corresponding byte position.
65 */63 */
66ZORBA_DLL_PUBLIC
67size_type byte_pos( storage_type const *s, size_type char_pos );64size_type byte_pos( storage_type const *s, size_type char_pos );
6865
69/**66/**
@@ -75,7 +72,6 @@
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 >=
76 * \a s_size.73 * \a s_size.
77 */74 */
78ZORBA_DLL_PUBLIC
79size_type byte_pos( storage_type const *s, size_type s_size,75size_type byte_pos( storage_type const *s, size_type s_size,
80 size_type char_pos );76 size_type char_pos );
8177
@@ -86,7 +82,6 @@
86 * @param p A pointer to somewhere within \a s.82 * @param p A pointer to somewhere within \a s.
87 * @return Returns said offset.83 * @return Returns said offset.
88 */84 */
89ZORBA_DLL_PUBLIC
90size_type char_pos( storage_type const *s, storage_type const *p );85size_type char_pos( storage_type const *s, storage_type const *p );
9186
92/**87/**
@@ -111,7 +106,6 @@
111 * character.106 * character.
112 * @return Returns the number of bytes required to encode the character.107 * @return Returns the number of bytes required to encode the character.
113 */108 */
114ZORBA_DLL_PUBLIC
115size_type encode( unicode::code_point c, storage_type **ps );109size_type encode( unicode::code_point c, storage_type **ps );
116110
117/**111/**
@@ -149,7 +143,6 @@
149 * @return Returns the Unicode code-point of the next character.143 * @return Returns the Unicode code-point of the next character.
150 */144 */
151template<class OctetIterator>145template<class OctetIterator>
152ZORBA_DLL_PUBLIC
153unicode::code_point next_char( OctetIterator &i );146unicode::code_point next_char( OctetIterator &i );
154147
155/**148/**
@@ -234,7 +227,6 @@
234 * @return Returns a number in the range [1,6] if \a start is valid or 0 if227 * @return Returns a number in the range [1,6] if \a start is valid or 0 if
235 * \a start is invalid.228 * \a start is invalid.
236 */229 */
237ZORBA_DLL_PUBLIC
238size_type char_length( storage_type start );230size_type char_length( storage_type start );
239231
240/**232/**
@@ -244,7 +236,6 @@
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.
245 * @return Returns said number of characters.237 * @return Returns said number of characters.
246 */238 */
247ZORBA_DLL_PUBLIC
248size_type length( storage_type const *s );239size_type length( storage_type const *s );
249240
250/**241/**
@@ -256,7 +247,6 @@
256 * sequence.247 * sequence.
257 * @return Returns said number of characters.248 * @return Returns said number of characters.
258 */249 */
259ZORBA_DLL_PUBLIC
260size_type length( storage_type const *begin, storage_type const *end );250size_type length( storage_type const *begin, storage_type const *end );
261251
262/**252/**
@@ -321,7 +311,6 @@
321 * @return Returns \c nullptr if the string is valid or a pointer to the first311 * @return Returns \c nullptr if the string is valid or a pointer to the first
322 * invalid byte if invalid.312 * invalid byte if invalid.
323 */313 */
324ZORBA_DLL_PUBLIC
325storage_type const* validate( storage_type const *s );314storage_type const* validate( storage_type const *s );
326315
327/**316/**
@@ -332,7 +321,6 @@
332 * @return Returns \c nullptr if the string is valid or a pointer to the first321 * @return Returns \c nullptr if the string is valid or a pointer to the first
333 * invalid byte if invalid.322 * invalid byte if invalid.
334 */323 */
335ZORBA_DLL_PUBLIC
336storage_type const* validate( storage_type const *s, size_type s_size );324storage_type const* validate( storage_type const *s, size_type s_size );
337325
338////////// iterator ///////////////////////////////////////////////////////////326////////// iterator ///////////////////////////////////////////////////////////
339327
=== modified file 'src/util/xml_util.h'
--- src/util/xml_util.h 2011-06-16 15:12:30 +0000
+++ src/util/xml_util.h 2012-01-19 09:11:24 +0000
@@ -191,7 +191,6 @@
191 * @return If successful, returns the number of characters parsed; otherwise191 * @return If successful, returns the number of characters parsed; otherwise
192 * returns -1.192 * returns -1.
193 */193 */
194ZORBA_DLL_PUBLIC
195int parse_entity( char const *ref, unicode::code_point *c );194int parse_entity( char const *ref, unicode::code_point *c );
196195
197/**196/**
198197
=== modified file 'test/unit/CMakeLists.txt'
--- test/unit/CMakeLists.txt 2012-01-11 17:30:25 +0000
+++ test/unit/CMakeLists.txt 2012-01-19 09:11:24 +0000
@@ -83,10 +83,7 @@
83 ext_in_opt.cpp83 ext_in_opt.cpp
84 collection.cpp84 collection.cpp
85 test_audit.cpp85 test_audit.cpp
86 string_instantiate.cpp
87 streamable_string.cpp86 streamable_string.cpp
88 string_test.cpp
89 unique_ptr.cpp
90 main_sequential.cpp87 main_sequential.cpp
91 context_item.cpp88 context_item.cpp
92 datetime.cpp89 datetime.cpp
@@ -96,13 +93,6 @@
96 staticcollectionmanager.cpp93 staticcollectionmanager.cpp
97)94)
9895
99IF (NOT ZORBA_NO_FULL_TEXT)
100 LIST(APPEND UNIT_TESTS_SRCS
101 stemmer.cpp
102 thesaurus.cpp
103 tokenizer.cpp)
104ENDIF (NOT ZORBA_NO_FULL_TEXT)
105
106# multithread_simple.cpp96# multithread_simple.cpp
107# multithread_stress_test.cpp97# multithread_stress_test.cpp
10898
@@ -140,5 +130,14 @@
140ZORBA_GENERATE_EXE(LibUnitTest lib_unit_test.cpp "" "" "")130ZORBA_GENERATE_EXE(LibUnitTest lib_unit_test.cpp "" "" "")
141131
142# ADD NEW UNIT TESTS HERE132# ADD NEW UNIT TESTS HERE
133ZORBA_ADD_TEST("test/libunit/string" LibUnitTest string)
143ZORBA_ADD_TEST("test/libunit/uri" LibUnitTest uri)134ZORBA_ADD_TEST("test/libunit/uri" LibUnitTest uri)
144EXPECTED_FAILURE(test/libunit/uri 3118348)135EXPECTED_FAILURE(test/libunit/uri 3118348)
136ZORBA_ADD_TEST("test/libunit/unique_ptr" LibUnitTest unique_ptr)
137IF (NOT ZORBA_NO_FULL_TEXT)
138 ZORBA_ADD_TEST("test/libunit/stemmer" LibUnitTest stemmer)
139 ZORBA_ADD_TEST("test/libunit/thesaurus" LibUnitTest thesaurus)
140 ZORBA_ADD_TEST("test/libunit/tokenizer" LibUnitTest tokenizer)
141ENDIF (NOT ZORBA_NO_FULL_TEXT)
142
143# vim:set et sw=2 ts=2:

Subscribers

People subscribed via source and target branches