Imported Upstream version 0.11.5 upstream/0.11.5
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Dec 2021 02:24:45 +0000 (11:24 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Dec 2021 02:24:45 +0000 (11:24 +0900)
24 files changed:
.travis.yml [new file with mode: 0644]
CMakeLists.txt
ChangeLog
INSTALL
THANKS
src/CMakeLists.txt
src/wbxml_base64.c
src/wbxml_buffers.c
src/wbxml_buffers.h
src/wbxml_charset.c
src/wbxml_conv.c
src/wbxml_elt.c
src/wbxml_encoder.c
src/wbxml_lists.c
src/wbxml_parser.c
src/wbxml_tables.c
src/wbxml_tree.c
test/api/CMakeLists.txt
test/api/test_wbxml_base64.c
test/api/test_wbxml_buffers.c
test/api/test_wbxml_errors.c
test/tools/CMakeLists.txt
test/tools/activesync/activesync-040-search-response.xml [new file with mode: 0644]
tools/CMakeLists.txt

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..c156415
--- /dev/null
@@ -0,0 +1,22 @@
+language: c
+compiler: 
+  - gcc
+  - clang
+os:
+  - linux
+  - osx
+
+before_install:
+  - if [ ${TRAVIS_OS_NAME} == "osx" ];
+    then brew update; else
+    sudo apt-get update -qq;
+    fi
+install:
+  - if [ ${TRAVIS_OS_NAME} == "osx" ];
+    then brew install check expat; else
+    sudo apt-get install -qq libexpat1-dev check;
+    fi
+
+before_script: cmake . -Bbuild
+script: cd build && make && make test
+
index dce5f21dc5797ae96cb0019372945303d501c7a1..8a810bd4cf74ade6b7b604282daf238b9de38a4c 100644 (file)
@@ -2,7 +2,7 @@ PROJECT( libwbxml C )
 
 SET( LIBWBXML_VERSION_MAJOR "0" )
 SET( LIBWBXML_VERSION_MINOR "11" )
-SET( LIBWBXML_VERSION_PATCH "4" )
+SET( LIBWBXML_VERSION_PATCH "5" )
 IF( LIBWBXML_VERSION_BETA )
     IF( LIBWBXML_VERSION_BETA VERSION_GREATER 90 )
         MATH( EXPR LIBWBXML_VERSION_MINOR "${LIBWBXML_VERSION_MINOR} - 1" )
@@ -134,6 +134,8 @@ ELSE( DIFF_PROGRAM )
        SET( ENABLE_DIFF OFF )
 ENDIF( DIFF_PROGRAM )
 
+OPTION( BUILD_SHARED_LIBS "Build wbxml as shared library" ON )
+OPTION( BUILD_STATIC_LIBS "Build wbxml as static library" OFF )
 OPTION( WBXML_LIB_VERBOSE "verbose mode" OFF )
 OPTION( WBXML_ENCODER_USE_STRTBL "enable string tables" ON )
 OPTION( WBXML_SUPPORT_WML "enable WML support" ON )
@@ -249,6 +251,12 @@ IF( RELEASE_CANDIDATE )
        SET( LIBWBXML_VERSION "${LIBWBXML_VERSION}-RC${RELEASE_CANDIDATE}" )
 ENDIF( RELEASE_CANDIDATE )
 
+find_program(CCACHE_FOUND ccache)
+if(CCACHE_FOUND)
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+endif(CCACHE_FOUND)
+
 # ADD_SUBDIRECTORY( wbxmlTestSuite )
 
 SET( CPACK_GENERATOR "TGZ;TBZ2" ) # This line is need for a CMake (Version 2.4.7) Bug - Fixed in CVS 
index 5926b777127dec1c1a6e5e6ac6952e2355b70132..d8894bcd169b734eff79b242ecc20650ae08228a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2017-02-12  Michael Bell <michael.bell@web.de>
+  * Released 0.11.5
+  * Fixed ActiveSync element data of code pages ResolveRecipients and
+    GAL (issue #52 from Thomas Führer, fixed in pull request #53).
+  * Added support for MacOS X to Travis CI environment.
+  * Added support for ccache (pull request #44 from Gaurav Gupta).
+  * Fixed some memory leaks (pull requests #43 and #45 from Renu Tyagi).
+  * Added definitions of ActiveSync protocoll v16.0
+    (pull request #32 from Gil Hartmann).
+  * Avoid malloc typecasts (pull requests #31, #33, #34, #35, #36,
+    #37, #38, #39 and #40 from Gaurav Gupta).
+  * Added support for automated testing with travis-ci.org
+  * Fixed memory leak in function wbxml_strtbl_collect_words
+    of wbxml_encoder (pull request #21 from Gaurav Gupta).
+  * Fixed memory leak in function wbxml_strtbl_check_references
+    of wbxml_encoder (pull request #20 from Gaurav Gupta).
+  * Added support to build a static library
+    (issue #22 and pull requests #23, #24, #25, #26 and #27
+    from Gaurav Gupta).
+  * If pkg-config is used then use the provided ldflags
+    (pull request #19 from Jeroen Dekkers).
+
 2015-04-09  Michael Bell <michael.bell@web.de>
   * Released 0.11.4
   * Get rid of the useless file MANIFEST (cmake don't need it).
diff --git a/INSTALL b/INSTALL
index 2bdff6dc7a6c408048778097de85eb5d8e04f8fd..dc84e60c9f4957df14ba25b043ca1066d6acc5dc 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -76,3 +76,6 @@
     WBXML_SUPPORT_WV : Support of Wireless-Village CSP 1.1 / CSP 1.2
     
     HAVE_EXPAT : Enable XML Parsing feature (needs Expat)
+    
+    BUILD_SHARED_LIBS : Build wbxml as shared library
+    BUILD_STATIC_LIBS : Build wbxml as static library
diff --git a/THANKS b/THANKS
index 41f25228744ef93f2b8cfbaf0df63d9aa08de1df..91c087afc1675bd5a9b6710de611043712fcf773 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -13,6 +13,7 @@ Pau Aliagas         <pau@smsarena.com>
 Michael Banck       (Debian package maintainer, testing)
 Michael Bell        <michael.bell@web.de>
 Gaurav Gupta        <g.gupta@samsung.com>
+Gil Hartmann        (Active Sync v16.0)
 Conrad Irwin        (performance fixes)
 Aymerick Jehanne    <aymerick@jehanne.org>
 Ossi Jormakka       (Ixonos Plc., ActiveSync)
@@ -21,6 +22,7 @@ Benedykt Kroplewski <benedykt@age.pl>
 Jeremy Lainé        (helped with cmake on Win32)
 Mark Ostrer         (Websense)
 Petr Písař          (RedHat/Fedora package maintainer)
+Renu Tyagi          (fixed some memory leaks)
 Boaz Yaniv          (MS Visual Studio fixes)
 
 If you think your name is missing here
index 3a25bb8d354f5686148502fd400ad927af267158..33a8d7235e2bd556669f3d75464e94dd7297c9bd 100644 (file)
@@ -1,3 +1,8 @@
+
+if(COMMAND cmake_policy AND POLICY CMP0042)
+       cmake_policy (SET CMP0042 NEW)
+endif(COMMAND cmake_policy AND POLICY CMP0042)
+
 LINK_DIRECTORIES( ${EXPAT_LIBRARY_DIRS} )
 
 INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${EXPAT_INCLUDE_DIRS} )
@@ -20,17 +25,35 @@ SET( libwbxml_LIB_SRCS
        wbxml_tree_clb_xml.c
 )
 
-ADD_LIBRARY( wbxml2 SHARED ${libwbxml_LIB_SRCS} )
+IF(BUILD_SHARED_LIBS)
+       ADD_LIBRARY( wbxml2 SHARED ${libwbxml_LIB_SRCS} )
 
-SET_TARGET_PROPERTIES( wbxml2 PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
-SET_TARGET_PROPERTIES( wbxml2 PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
-TARGET_LINK_LIBRARIES( wbxml2 ${EXPAT_LIBRARIES} )
+       SET_TARGET_PROPERTIES( wbxml2 PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
+       SET_TARGET_PROPERTIES( wbxml2 PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
+       TARGET_LINK_LIBRARIES( wbxml2 ${EXPAT_LIBRARIES} )
+
+       INSTALL( TARGETS wbxml2
+          RUNTIME DESTINATION ${LIBWBXML_BIN_DIR}
+          LIBRARY DESTINATION ${LIBWBXML_LIBRARIES_DIR}
+          ARCHIVE DESTINATION ${LIBWBXML_LIBRARIES_DIR}
+       )
+ENDIF()
+
+IF(BUILD_STATIC_LIBS)
+       ADD_LIBRARY( wbxml2_static STATIC ${libwbxml_LIB_SRCS} )
+
+       SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
+       SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
+       TARGET_LINK_LIBRARIES( wbxml2_static ${EXPAT_LIBRARIES} )
+       SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES OUTPUT_NAME wbxml2 )
+
+       INSTALL( TARGETS wbxml2_static
+          RUNTIME DESTINATION ${LIBWBXML_BIN_DIR}
+          LIBRARY DESTINATION ${LIBWBXML_LIBRARIES_DIR}
+          ARCHIVE DESTINATION ${LIBWBXML_LIBRARIES_DIR}
+       )
+ENDIF()
 
-INSTALL( TARGETS wbxml2
-   RUNTIME DESTINATION ${LIBWBXML_BIN_DIR}
-   LIBRARY DESTINATION ${LIBWBXML_LIBRARIES_DIR}
-   ARCHIVE DESTINATION ${LIBWBXML_LIBRARIES_DIR}
-)
 
 INSTALL( FILES
        wbxml.h
index 45a2188183b224c0fba73aa791db59b137e232fd..5c761883338710d0816f382728939765c6f056d3 100644 (file)
@@ -79,7 +79,7 @@ WBXML_DECLARE(WB_UTINY *) wbxml_base64_encode(const WB_UTINY *buffer, WB_LONG le
         return NULL;
 
     /* Malloc result buffer */
-    if ((result = (WB_UTINY *) wbxml_malloc(((len + 2) / 3 * 4) + 1 + 1)) == NULL)
+    if ((result = wbxml_malloc(((len + 2) / 3 * 4) + 1 + 1)) == NULL)
         return NULL;
 
     p = result;
@@ -134,7 +134,7 @@ WBXML_DECLARE(WB_LONG) wbxml_base64_decode(const WB_UTINY *buffer, WB_LONG len,
     nbytesdecoded = ((nprbytes + 3) / 4) * 3;
     
     /* Malloc result buffer */
-    if ((*result = (WB_UTINY*) wbxml_malloc(nbytesdecoded + 1)) == NULL)
+    if ((*result = wbxml_malloc(nbytesdecoded + 1)) == NULL)
         return 0;
 
     bufout = *result;
index bc9a19d2f50225006b08d1fcbb0459a52aa4b6df..a38ae8598efd446d27e344f74640d62612a0b603 100644 (file)
@@ -71,7 +71,7 @@ WBXML_DECLARE(WBXMLBuffer *) wbxml_buffer_create_real(const WB_UTINY *data, WB_U
 {
     WBXMLBuffer *buffer = NULL;
 
-    buffer = (WBXMLBuffer *) wbxml_malloc(sizeof(WBXMLBuffer));
+    buffer = wbxml_malloc(sizeof(WBXMLBuffer));
     if (buffer == NULL)
         return NULL;
         
@@ -88,7 +88,7 @@ WBXML_DECLARE(WBXMLBuffer *) wbxml_buffer_create_real(const WB_UTINY *data, WB_U
         else
             buffer->malloced = malloc_block + 1;
         
-        buffer->data = (WB_UTINY *) wbxml_malloc(buffer->malloced * sizeof(WB_UTINY));
+        buffer->data = wbxml_malloc(buffer->malloced * sizeof(WB_UTINY));
         if (buffer->data == NULL) {
             wbxml_free(buffer);
             return NULL;
@@ -107,7 +107,7 @@ WBXML_DECLARE(WBXMLBuffer *) wbxml_buffer_sta_create_real(const WB_UTINY *data,
 {
     WBXMLBuffer *buffer = NULL;
   
-    buffer = (WBXMLBuffer *) wbxml_malloc(sizeof(WBXMLBuffer));
+    buffer = wbxml_malloc(sizeof(WBXMLBuffer));
     if (buffer == NULL) {
         return NULL;
     }
@@ -518,7 +518,7 @@ WBXML_DECLARE(WBXMLList *) wbxml_buffer_split_words_real(WBXMLBuffer *buff)
 }
 
 
-WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_char(WBXMLBuffer *to, WB_UTINY ch, WB_ULONG pos, WB_ULONG *result)
+WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_char(WBXMLBuffer *to, const WB_UTINY ch, WB_ULONG pos, WB_ULONG *result)
 {
     WB_UTINY *p = NULL;
 
@@ -578,7 +578,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_search(WBXMLBuffer *to, WBXMLBuffer *search,
 }
 
 
-WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_cstr(WBXMLBuffer *to, WB_UTINY *search, WB_ULONG pos, WB_ULONG *result)
+WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_cstr(WBXMLBuffer *to, const WB_UTINY *search, WB_ULONG pos, WB_ULONG *result)
 {
     WB_UTINY first = 0;
 
index 3026447f5c164bd296f6679a185a21ab242b7e3b..f6c08e5a89e0150aea1632e07faf23471e124639 100644 (file)
@@ -269,7 +269,7 @@ WBXML_DECLARE(WBXMLList *) wbxml_buffer_split_words_real(WBXMLBuffer *buff);
  * @param result The start position of char in 'to' buffer
  * @return TRUE if char successfully found in 'to' buffer, FALSE otherwise
  */
-WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_char(WBXMLBuffer *to, WB_UTINY ch, WB_ULONG pos, WB_ULONG *result);
+WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_char(WBXMLBuffer *to, const WB_UTINY ch, WB_ULONG pos, WB_ULONG *result);
 
 /**
  * @brief Search a Buffer in another Buffer
@@ -289,7 +289,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_search(WBXMLBuffer *to, WBXMLBuffer *search,
  * @param result The start position of 'search' buffer in 'to' buffer
  * @return TRUE if successfully found 'search' in 'to' buffer, FALSE otherwise
  */
-WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_cstr(WBXMLBuffer *to, WB_UTINY *search, WB_ULONG pos, WB_ULONG *result);
+WBXML_DECLARE(WB_BOOL) wbxml_buffer_search_cstr(WBXMLBuffer *to, const WB_UTINY *search, WB_ULONG pos, WB_ULONG *result);
 
 /**
  * @brief Check if a buffer contains only Whitespaces
index 8adfde1ebc3156e323beeb94b33a1b1cc98255ed..66bc784f101fbb786490c625725712036b68e559 100644 (file)
@@ -187,7 +187,7 @@ WBXML_DECLARE(WBXMLError) wbxml_charset_conv(const WB_TINY        *in_buf,
         /* Allocate maximum result buffer (4 bytes unicode) */
         tmp_len_left = tmp_buf_len = 4 * (sizeof(WB_TINY) * (*io_bytes));
     
-        if ((tmp_buf = (WB_TINY *) wbxml_malloc(tmp_buf_len)) == NULL) {
+        if ((tmp_buf = wbxml_malloc(tmp_buf_len)) == NULL) {
             iconv_close(cd);
             return WBXML_ERROR_NOT_ENOUGH_MEMORY;
         }
index b1a0b4ddd508e66982f3486a194d781d7bf2a0dd..e443b37a4490ce6a9d06a0c12374fdead73041d7 100644 (file)
@@ -68,7 +68,7 @@ WBXML_DECLARE(WBXMLError) wbxml_conv_wbxml2xml_create(WBXMLConvWBXML2XML **conv)
         return WBXML_ERROR_BAD_PARAMETER;
     }
 
-    *conv = (WBXMLConvWBXML2XML *) wbxml_malloc(sizeof(WBXMLConvWBXML2XML));
+    *conv = wbxml_malloc(sizeof(WBXMLConvWBXML2XML));
     if (*conv == NULL) {
         return WBXML_ERROR_NOT_ENOUGH_MEMORY;
     }
@@ -216,7 +216,7 @@ WBXML_DECLARE(WBXMLError) wbxml_conv_xml2wbxml_create(WBXMLConvXML2WBXML **conv)
         return WBXML_ERROR_BAD_PARAMETER;
     }
 
-    *conv = (WBXMLConvXML2WBXML *) wbxml_malloc(sizeof(WBXMLConvXML2WBXML));
+    *conv = wbxml_malloc(sizeof(WBXMLConvXML2WBXML));
     if (*conv == NULL) {
         return WBXML_ERROR_NOT_ENOUGH_MEMORY;
     }
index 28dafd66f9975f42e833a56bc69b587b67a1db14..cbe33d1e1068579fd5eeb0512118d8de8b7a6d21 100644 (file)
@@ -51,7 +51,7 @@ WBXML_DECLARE(WBXMLTag *) wbxml_tag_create(WBXMLValueType type)
 {
     WBXMLTag *result = NULL;
     
-    if ((result = (WBXMLTag *) wbxml_malloc(sizeof(WBXMLTag))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLTag))) == NULL)
         return NULL;
 
     result->type = type;
@@ -115,7 +115,7 @@ WBXML_DECLARE(WBXMLTag *) wbxml_tag_duplicate(WBXMLTag *tag)
     if (tag == NULL)
         return NULL;
 
-    if ((result = (WBXMLTag *) wbxml_malloc(sizeof(WBXMLTag))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLTag))) == NULL)
         return NULL;
 
     result->type = tag->type;
@@ -160,7 +160,7 @@ WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_create(WBXMLValueType t
 {
     WBXMLAttributeName *result = NULL;
     
-    if ((result = (WBXMLAttributeName *) wbxml_malloc(sizeof(WBXMLAttributeName))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLAttributeName))) == NULL)
         return NULL;
 
     result->type = type;
@@ -224,7 +224,7 @@ WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_duplicate(WBXMLAttribut
     if (name == NULL)
         return NULL;
 
-    if ((result = (WBXMLAttributeName *) wbxml_malloc(sizeof(WBXMLAttributeName))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLAttributeName))) == NULL)
         return NULL;
 
     result->type = name->type;
@@ -269,7 +269,7 @@ WBXML_DECLARE(WBXMLAttribute *) wbxml_attribute_create(void)
 {
     WBXMLAttribute *result = NULL;
     
-    if ((result = (WBXMLAttribute *) wbxml_malloc(sizeof(WBXMLAttribute))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLAttribute))) == NULL)
         return NULL;
 
     result->name = NULL;
@@ -304,7 +304,7 @@ WBXML_DECLARE(WBXMLAttribute *) wbxml_attribute_duplicate(WBXMLAttribute *attr)
     if (attr == NULL)
         return NULL;
 
-    if ((result = (WBXMLAttribute *) wbxml_malloc(sizeof(WBXMLAttribute))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLAttribute))) == NULL)
         return NULL;
 
     result->name = wbxml_attribute_name_duplicate(attr->name);
index a6e442e992fabd99d0622e55925b152a0a981d87..cd2d6bc2cffa3826c571a5f359627eeabb86eb5a 100644 (file)
@@ -378,7 +378,7 @@ WBXML_DECLARE(WBXMLEncoder *) wbxml_encoder_create_real(void)
 {
     WBXMLEncoder *encoder = NULL;
 
-    encoder = (WBXMLEncoder *) wbxml_malloc(sizeof(WBXMLEncoder));
+    encoder = wbxml_malloc(sizeof(WBXMLEncoder));
     if (encoder == NULL) {
         return NULL;
     }
@@ -1472,7 +1472,7 @@ static WBXMLError wbxml_build_result(WBXMLEncoder *encoder, WB_UTINY **wbxml, WB
     *wbxml_len = wbxml_buffer_len(header) + wbxml_buffer_len(encoder->output);
 
     /* Create Result Buffer */
-    *wbxml = (WB_UTINY *) wbxml_malloc(*wbxml_len * sizeof(WB_UTINY));
+    *wbxml = wbxml_malloc(*wbxml_len * sizeof(WB_UTINY));
     if (*wbxml == NULL) {
         if (encoder->flow_mode == FALSE)
             wbxml_buffer_destroy(header);
@@ -1673,6 +1673,9 @@ static WBXMLError wbxml_encode_tag(WBXMLEncoder *encoder, WBXMLTreeNode *node, W
     const WBXMLTagEntry *tag = NULL;
     WB_UTINY token = 0x00, page = 0x00;
 
+    if (!node || !node->name) {
+       return WBXML_ERROR_UNKNOWN_TAG;
+    }
     if (node->name->type == WBXML_VALUE_TOKEN) {
         token = node->name->u.token->wbxmlToken;
         page = node->name->u.token->wbxmlCodePage;
@@ -2617,7 +2620,7 @@ static WBXMLValueElement *wbxml_value_element_create(void)
 {
     WBXMLValueElement *elt = NULL;
 
-    if ((elt = (WBXMLValueElement*) wbxml_malloc(sizeof(WBXMLValueElement))) == NULL)
+    if ((elt = wbxml_malloc(sizeof(WBXMLValueElement))) == NULL)
         return NULL;
 
     elt->type = WBXML_VALUE_ELEMENT_STRING;
@@ -3568,7 +3571,7 @@ static WBXMLStringTableElement *wbxml_strtbl_element_create(WBXMLBuffer *string,
 {
     WBXMLStringTableElement *elt = NULL;
 
-    if ((elt = (WBXMLStringTableElement *) wbxml_malloc(sizeof(WBXMLStringTableElement))) == NULL)
+    if ((elt = wbxml_malloc(sizeof(WBXMLStringTableElement))) == NULL)
         return NULL;
 
     elt->string = string;
@@ -3760,6 +3763,7 @@ static WBXMLError wbxml_strtbl_collect_words(WBXMLList *elements, WBXMLList **re
             /* There is a bug inside the wbxml strtbl implementation.
                wbxml_list must be used in a wrong way.
              */
+            wbxml_list_destroy(list, wbxml_buffer_destroy_item);
             return WBXML_ERROR_INTERNAL;
         }
 
@@ -3870,6 +3874,7 @@ static WBXMLError wbxml_strtbl_check_references(WBXMLEncoder *encoder, WBXMLList
                if (!stat_buff)
                     wbxml_buffer_destroy(string);
                 string = NULL;
+                wbxml_list_destroy(referenced, wbxml_strtbl_element_destroy_item);
                 return WBXML_ERROR_INTERNAL;
             }
 
@@ -4071,7 +4076,7 @@ static WBXMLError xml_build_result(WBXMLEncoder *encoder, WB_UTINY **xml, WB_ULO
     len = wbxml_buffer_len(header) + wbxml_buffer_len(encoder->output);
 
     /* Create Result Buffer */
-    *xml = (WB_UTINY *) wbxml_malloc((len + 1) * sizeof(WB_UTINY));
+    *xml = wbxml_malloc((len + 1) * sizeof(WB_UTINY));
     if (*xml == NULL) {
         if (encoder->flow_mode == FALSE)
             wbxml_buffer_destroy(header);
index c378e6899c2f798d77f59ae2a870f0b0754f5f8e..d6cb219416673c22ca1c75baa7f47777fb58c71a 100644 (file)
@@ -66,7 +66,7 @@ WBXML_DECLARE(WBXMLList *) wbxml_list_create_real(void)
 {
     WBXMLList *list = NULL;
     
-    if ((list = (WBXMLList *) wbxml_malloc(sizeof(WBXMLList))) == NULL)
+    if ((list = wbxml_malloc(sizeof(WBXMLList))) == NULL)
         return NULL;
 
     list->head = NULL;
@@ -244,7 +244,7 @@ static WBXMLListElt *wbxml_elt_create_real(void *item)
     if (item == NULL)
         return NULL;
 
-    if ((elt = (WBXMLListElt *) wbxml_malloc(sizeof(WBXMLListElt))) == NULL)
+    if ((elt = wbxml_malloc(sizeof(WBXMLListElt))) == NULL)
         return NULL;
 
     elt->item = item;
index eeeb82ebf2c33f884a416ceb7d320897f426d15b..c7f8dda4c237843c27cc4c031032b0b80cf4b5d4 100644 (file)
@@ -182,7 +182,7 @@ WBXML_DECLARE(WBXMLParser *) wbxml_parser_create(void)
 {
     WBXMLParser *parser = NULL;
 
-    parser = (WBXMLParser *) wbxml_malloc(sizeof(WBXMLParser));
+    parser = wbxml_malloc(sizeof(WBXMLParser));
     if (parser == NULL) {
         return NULL;
     }
@@ -1582,7 +1582,7 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space
         }
 
         /* Build Variable */
-        ext = (WB_UTINY*) wbxml_malloc(WBXML_STRLEN(var_begin) +
+        ext = wbxml_malloc(WBXML_STRLEN(var_begin) +
                                        wbxml_buffer_len(var_value) +
                                        WBXML_STRLEN(escape) +
                                        WBXML_STRLEN(var_end) + 1);
@@ -1625,6 +1625,7 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space
             break;
 
         default:
+            wbxml_free(ext);
             return WBXML_ERROR_UNKNOWN_EXTENSION_TOKEN;
         }
     
@@ -1672,6 +1673,7 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space
 #if WBXML_PARSER_BEST_EFFORT
             ext = (WB_UTINY *) wbxml_strdup((const WB_TINY*) WBXML_PARSER_UNKNOWN_STRING);
             len = WBXML_STRLEN(WBXML_PARSER_UNKNOWN_STRING);
+            wbxml_free(ext);
             return WBXML_OK;
 #else
             return WBXML_ERROR_UNKNOWN_EXTENSION_VALUE;
index 6408211174b8df8111437efc9aa1f70d65f98082..fc678f8a17a78d578c68dbe563a05d10379d474d 100644 (file)
@@ -2803,6 +2803,7 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "FirstDayOfWeek",         0x04, 0x39 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "OnlineMeetingConfLink",  0x04, 0x3a }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "OnlineMeetingExternalLink",0x04, 0x3b }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
+    { "ClientUid",              0x04, 0x3c }, /* since 16.0 */
 
     /* Code Page: Move (since v2.5 and r1.0) */
     { "MoveItems",              0x05, 0x05 }, /* corrected in libwbxml 0.11.0, supported since v2.5 */
@@ -2859,6 +2860,7 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "UserResponse",           0x08, 0x0c }, /* since r1.0 */
     { "Version",                0x08, 0x0d }, /* not defined in r8.0 but in r1.0 */
     { "InstanceId",             0x08, 0x0e }, /* since r8.0? */
+    { "SendResponse",           0x08, 0x12 }, /* since 16.0 */
 
     /* Code Page: Tasks (since v2.5 and r1.0) */
     { "Body",                   0x09, 0x05 }, /* not defined in r8.0 but in r1.0, supported by v2.5, v12.0 and v12.1 */
@@ -2921,7 +2923,7 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "MergedFreeBusy",         0x0a, 0x19 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 */
     { "Picture",                0x0a, 0x1a }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "MaxSize",                0x0a, 0x1b }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
-    { "Data",                   0x0a, 0x1c }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
+    { "Data",                   0x0a, 0x1c, WBXML_TAG_OPTION_BINARY }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "MaxPictures",            0x0a, 0x1d }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
 
     /* Code Page: ValidateCert (since v2.5 and r1.0) */
@@ -3058,7 +3060,7 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "EmailAddress",           0x10, 0x0f }, /* since r1.0 */
     { "Picture",                0x10, 0x10 }, /* not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "Status",                 0x10, 0x11 }, /* not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
-    { "Data",                   0x10, 0x12 }, /* not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
+    { "Data",                   0x10, 0x12, WBXML_TAG_OPTION_BINARY }, /* not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
 
     /* Code Page: AirSyncBase (since v12.0 and r1.0) */
     { "BodyPreference",         0x11, 0x05 }, /* since r1.0 */
@@ -3083,6 +3085,24 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "BodyPartPreference",     0x11, 0x19 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 or 14 */
     { "BodyPart",               0x11, 0x1a }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 or 14 */
     { "Status",                 0x11, 0x1b }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 or 14 */
+    { "Add",                    0x11, 0x1c }, /* since 16.0 */
+    { "Delete",                 0x11, 0x1d }, /* since 16.0 */
+    { "ClientId",               0x11, 0x1e }, /* since 16.0 */
+    { "Content",                0x11, 0x1f }, /* since 16.0 */
+    { "Location",               0x11, 0x20 }, /* since 16.0 */
+    { "Annotation",             0x11, 0x21 }, /* since 16.0 */
+    { "Street",                 0x11, 0x22 }, /* since 16.0 */
+    { "City",                   0x11, 0x23 }, /* since 16.0 */
+    { "State",                  0x11, 0x24 }, /* since 16.0 */
+    { "Country",                0x11, 0x25 }, /* since 16.0 */
+    { "PostalCode",             0x11, 0x26 }, /* since 16.0 */
+    { "Latitude",               0x11, 0x27 }, /* since 16.0 */
+    { "Longitude",              0x11, 0x28 }, /* since 16.0 */
+    { "Accuracy",               0x11, 0x29 }, /* since 16.0 */
+    { "Altitude",               0x11, 0x2a }, /* since 16.0 */
+    { "AltitudeAccuracy",       0x11, 0x2b }, /* since 16.0 */
+    { "LocationUri",            0x11, 0x2c }, /* since 16.0 */
+    { "InstanceId",             0x11, 0x2d }, /* since 16.0 */
 
     /* Code Page: Settings (since v12.1 and r1.0) */
     { "Settings",                   0x12, 0x05 }, /* since r1.0 */
@@ -3173,6 +3193,10 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "ClientId",               0x15, 0x11 }, /* since r8.0? */
     { "Status",                 0x15, 0x12 }, /* since r8.0? */
     { "AccountId",              0x15, 0x13 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
+    { "Forwardees",             0x15, 0x15 }, /* since 16.0 */
+    { "Forwardee",              0x15, 0x16 }, /* since 16.0 */
+    { "ForwardeeName",          0x15, 0x17 }, /* since 16.0 */
+    { "ForwardeeEmail",         0x15, 0x18 }, /* since 16.0 */
 
     /* Code Page: Email2 (since v14.0 and r8.0?) */
     /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 */
@@ -3191,6 +3215,9 @@ const WBXMLTagEntry sv_airsync_tag_table[] = {
     { "AccountId",              0x16, 0x11 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "FirstDayOfWeek",         0x16, 0x12 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
     { "MeetingMessageType",     0x16, 0x13 }, /* r8.0: not supported when the MS-ASProtocolVersion header is set to 14.0 or 12.1 */
+    { "IsDraft",                0x16, 0x15 }, /* since 16.0 */
+    { "Bcc",                    0x16, 0x16 }, /* since 16.0 */
+    { "Send",                   0x16, 0x17 }, /* since 16.0 */
 
     /* Code Page: Notes (since v14.0 and r8.0?) */
     /* r8.0: not supported when the MS-ASProtocolVersion header is set to 12.1 */
index 963c7ee263560e1a8afae2669565f494c31e401e..f1d9de8a2cf0f8734214cc008d4177b62d4bb3d6 100644 (file)
@@ -383,7 +383,7 @@ WBXML_DECLARE(WBXMLTreeNode *) wbxml_tree_node_create(WBXMLTreeNodeType type)
 {
     WBXMLTreeNode *result = NULL;
     
-    if ((result = (WBXMLTreeNode *) wbxml_malloc(sizeof(WBXMLTreeNode))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLTreeNode))) == NULL)
         return NULL;
 
     result->type = type;
@@ -972,7 +972,7 @@ WBXML_DECLARE(WBXMLTree *) wbxml_tree_create(WBXMLLanguage lang,
 {
     WBXMLTree *result = NULL;
     
-    if ((result = (WBXMLTree *) wbxml_malloc(sizeof(WBXMLTree))) == NULL)
+    if ((result = wbxml_malloc(sizeof(WBXMLTree))) == NULL)
         return NULL;
 
     result->lang = wbxml_tables_get_table(lang);
index 2bd9d11a70cfc49a23343987d704f3bb6b11759f..d3451d772f3dd893ed882c54466a3cc411353425 100644 (file)
@@ -14,8 +14,17 @@ FOREACH( SRC_FILE lists buffers base64 charset conv encoder_internals errors par
 
     ADD_EXECUTABLE(test_wbxml_${SRC_FILE} test_wbxml_${SRC_FILE}.c api_test.c)
 
+IF(BUILD_SHARED_LIBS)    
     TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} wbxml2)
+ELSE(BUILD_SHARED_LIBS)
+    TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} wbxml2_static)
+ENDIF()
+
+    IF( PKG_CONFIG_FOUND )
+    TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} ${CHECK_LDFLAGS})
+    ELSE ( PKG_CONFIG_FOUND )
     TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} ${CHECK_LIBRARIES})
+    ENDIF ( PKG_CONFIG_FOUND )
 
     ADD_TEST(api_private_wbxml_${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/test_wbxml_${SRC_FILE})
 
index 6408211655b43e265855dcc1b08731c4d2e7a238..c22b59cb89679bfe2bcfcdf4dda4736889e39cc2 100644 (file)
@@ -1,6 +1,7 @@
 #include "api_test.h"
 
 #include "../../src/wbxml_base64.h"
+#include "../../src/wbxml_mem.h"
 
 START_TEST (test_encode)
 {
@@ -11,15 +12,15 @@ START_TEST (test_encode)
     ck_assert(wbxml_base64_encode(NULL, 0) == NULL);
     ck_assert(wbxml_base64_encode(NULL, 1) == NULL);
 
-    ck_assert(wbxml_base64_encode("", 0) == NULL);
-    ck_assert(wbxml_base64_encode("test", 0) == NULL);
+    ck_assert(wbxml_base64_encode((const WB_UTINY*) "", 0) == NULL);
+    ck_assert(wbxml_base64_encode((const WB_UTINY*) "test", 0) == NULL);
 
     /* encode a string */
 
-    result = wbxml_base64_encode("test", 4);
+    result = wbxml_base64_encode((const WB_UTINY*) "test", 4);
     ck_assert(result != NULL);
-    ck_assert(strlen(result) == 8);
-    ck_assert(strncmp(result, "dGVzdA==", 8) == 0);
+    ck_assert(WBXML_STRLEN(result) == 8);
+    ck_assert(WBXML_STRNCMP(result, "dGVzdA==", 8) == 0);
     wbxml_free(result);
 }
 END_TEST
@@ -32,13 +33,13 @@ START_TEST (test_decode)
 
     ck_assert(wbxml_base64_decode(NULL, 0, &result) <= 0);
     ck_assert(wbxml_base64_decode(NULL, 1, &result) <= 0);
-    ck_assert(wbxml_base64_decode("", 0, &result) <= 0);
-    ck_assert(wbxml_base64_decode("test", 0, &result) <= 0);
+    ck_assert(wbxml_base64_decode((const WB_UTINY*) "", 0, &result) <= 0);
+    ck_assert(wbxml_base64_decode((const WB_UTINY*) "test", 0, &result) <= 0);
 
     /* decode a string */
 
-    ck_assert(wbxml_base64_decode("dGVzdA==", 8, &result) == 4);
-    ck_assert(strncmp(result, "test", 4) == 0);
+    ck_assert(wbxml_base64_decode((const WB_UTINY*) "dGVzdA==", 8, &result) == 4);
+    ck_assert(WBXML_STRNCMP(result, "test", 4) == 0);
     wbxml_free(result);
 }
 END_TEST
@@ -50,9 +51,9 @@ START_TEST (test_encode_and_decode)
 
     /* encode */
 
-    enc = wbxml_base64_encode("test", 4);
-    ck_assert(wbxml_base64_decode(enc, strlen(enc), &dec) == 4);
-    ck_assert(strncmp(dec, "test", 4) == 0);
+    enc = wbxml_base64_encode((const WB_UTINY*) "test", 4);
+    ck_assert(wbxml_base64_decode(enc, WBXML_STRLEN(enc), &dec) == 4);
+    ck_assert(WBXML_STRNCMP(dec, "test", 4) == 0);
     wbxml_free(enc);
     wbxml_free(dec);
 }
index 17ee6c360fa577d073049fecbf6495b69d84f6ea..01ce636b10603cc844a6e69d193a6ab9680a46ed 100644 (file)
@@ -58,7 +58,7 @@ START_TEST (test_init_and_destroy_static)
     ck_assert( ! wbxml_buffer_set_char(buf, 3, 'c'));
 
     ck_assert( ! wbxml_buffer_insert(buf, buf2, 2));
-    ck_assert( ! wbxml_buffer_insert_cstr(buf, t2, 2));
+    ck_assert( ! wbxml_buffer_insert_cstr(buf, (const WB_UTINY*) t2, 2));
 
     ck_assert( ! wbxml_buffer_append(buf, buf2));
     ck_assert( ! wbxml_buffer_append_data(buf, t2, 2));
@@ -95,19 +95,19 @@ START_TEST (test_set_char)
     /* set first char */
 
     ck_assert(wbxml_buffer_set_char(buf, 0, 'T'));
-    ck_assert(wbxml_buffer_get_char(buf, 0, &c));
+    ck_assert(wbxml_buffer_get_char(buf, 0, (WB_UTINY *) &c));
     ck_assert(c == 'T');
 
     /* set middle char */
 
     ck_assert(wbxml_buffer_set_char(buf, 2, 'S'));
-    ck_assert(wbxml_buffer_get_char(buf, 2, &c));
+    ck_assert(wbxml_buffer_get_char(buf, 2, (WB_UTINY *) &c));
     ck_assert(c == 'S');
 
     /* set last char */
 
     ck_assert(wbxml_buffer_set_char(buf, 5, '2'));
-    ck_assert(wbxml_buffer_get_char(buf, 5, &c));
+    ck_assert(wbxml_buffer_get_char(buf, 5, (WB_UTINY *) &c));
     ck_assert(c == '2');
 
     /* set last+1 char */
@@ -198,36 +198,36 @@ START_TEST (test_insert)
 
     /* insert to an empty buffer */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "test", 0));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "test", 0));
     ck_assert(wbxml_buffer_len(buf) == 4);
 
     /* insert to head */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "1", 0));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "1", 0));
     ck_assert(wbxml_buffer_len(buf) == 5);
     ck_assert(wbxml_buffer_compare_cstr(buf, "1test") == 0);
 
     /* insert into middle */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "23", 1));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "23", 1));
     ck_assert(wbxml_buffer_len(buf) == 7);
     ck_assert(wbxml_buffer_compare_cstr(buf, "123test") == 0);
 
     /* insert at end */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "7", 6));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "7", 6));
     ck_assert(wbxml_buffer_len(buf) == 8);
     ck_assert(wbxml_buffer_compare_cstr(buf, "123tes7t") == 0);
 
     /* insert after end */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "9", 8));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "9", 8));
     ck_assert(wbxml_buffer_len(buf) == 9);
     ck_assert(wbxml_buffer_compare_cstr(buf, "123tes7t9") == 0);
 
     /* insert far after end */
 
-    ck_assert( ! wbxml_buffer_insert_cstr(buf, "10", 10));
+    ck_assert( ! wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "10", 10));
     ck_assert(wbxml_buffer_len(buf) == 9);
     ck_assert(wbxml_buffer_compare_cstr(buf, "123tes7t9") == 0);
 
@@ -261,7 +261,7 @@ START_TEST (test_delete)
 
     /* insert */
 
-    ck_assert(wbxml_buffer_insert_cstr(buf, "test", 0));
+    ck_assert(wbxml_buffer_insert_cstr(buf, (const WB_UTINY *) "test", 0));
     ck_assert(wbxml_buffer_len(buf) == 4);
 
     /* delete head */
@@ -354,12 +354,12 @@ START_TEST (test_search)
     ck_assert(! wbxml_buffer_search(buf, buf2, 0, &l));
     ck_assert(! wbxml_buffer_search(buf, NULL, 0, &l));
 
-    ck_assert(! wbxml_buffer_search_cstr(NULL, "123", 0, &l));
-    ck_assert(! wbxml_buffer_search_cstr(NULL, "", 0, &l));
+    ck_assert(! wbxml_buffer_search_cstr(NULL, (const WB_UTINY *) "123", 0, &l));
+    ck_assert(! wbxml_buffer_search_cstr(NULL, (const WB_UTINY *) "", 0, &l));
     ck_assert(! wbxml_buffer_search_cstr(NULL, NULL, 0, &l));
-    ck_assert(! wbxml_buffer_search_cstr(buf, "123", 0, &l));
+    ck_assert(! wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "123", 0, &l));
     l = 1;
-    ck_assert(wbxml_buffer_search_cstr(buf, "", 0, &l));
+    ck_assert(wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "", 0, &l));
     ck_assert(l == 0);
     ck_assert(! wbxml_buffer_search_cstr(buf, NULL, 0, &l));
 
@@ -382,10 +382,10 @@ START_TEST (test_search)
     ck_assert(! wbxml_buffer_search(buf, buf2, 5, NULL));
 
     l = 1;
-    ck_assert(wbxml_buffer_search_cstr(buf, "123", 0, &l));
+    ck_assert(wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "123", 0, &l));
     ck_assert(l == 4);
-    ck_assert(wbxml_buffer_search_cstr(buf, "123", 0, NULL));
-    ck_assert(wbxml_buffer_search_cstr(buf, "", 0, &l));
+    ck_assert(wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "123", 0, NULL));
+    ck_assert(wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "", 0, &l));
     ck_assert(l == 0);
     ck_assert(! wbxml_buffer_search_cstr(buf, NULL, 0, &l));
 
@@ -393,7 +393,7 @@ START_TEST (test_search)
 
     ck_assert(! wbxml_buffer_search_char(buf, '3', wbxml_buffer_len(buf), &l));
     ck_assert(! wbxml_buffer_search(buf, buf2, wbxml_buffer_len(buf), &l));
-    ck_assert(! wbxml_buffer_search_cstr(buf, "3", wbxml_buffer_len(buf), &l));
+    ck_assert(! wbxml_buffer_search_cstr(buf, (const WB_UTINY *) "3", wbxml_buffer_len(buf), &l));
 
     wbxml_buffer_destroy(buf);
     wbxml_buffer_destroy(buf2);
index be8159e9dee6f5aa04167944742beb41e2f78702..fe75ba27ef53ea20fed816c8028c74258dd36359 100644 (file)
@@ -4,31 +4,31 @@
 
 START_TEST (security_test_errors_datetime_without_percent)
 {
-    ck_assert(strchr(wbxml_errors_string(WBXML_ERROR_BAD_DATETIME), '%') == NULL);
+    ck_assert(WBXML_STRSTR(wbxml_errors_string(WBXML_ERROR_BAD_DATETIME), "%") == NULL);
 }
 END_TEST
 
 START_TEST (test_errors_ok)
 {
     ck_assert(wbxml_errors_string(WBXML_OK) != NULL);
-    ck_assert(strcmp(wbxml_errors_string(WBXML_OK), "Unknown Error Code") != 0);
+    ck_assert(WBXML_STRCMP(wbxml_errors_string(WBXML_OK), "Unknown Error Code") != 0);
 }
 END_TEST
 
 START_TEST (test_errors_last_item)
 {
     ck_assert(wbxml_errors_string(WBXML_ERROR_XMLPARSER_OUTPUT_UTF16) != NULL);
-    ck_assert(strcmp(wbxml_errors_string(WBXML_ERROR_XMLPARSER_OUTPUT_UTF16), "Unknown Error Code") != 0);
+    ck_assert(WBXML_STRCMP(wbxml_errors_string(WBXML_ERROR_XMLPARSER_OUTPUT_UTF16), "Unknown Error Code") != 0);
 
     ck_assert(wbxml_errors_string(WBXML_ERROR_CHARSET_NOT_FOUND) != NULL);
-    ck_assert(strcmp(wbxml_errors_string(WBXML_ERROR_CHARSET_NOT_FOUND), "Unknown Error Code") != 0);
+    ck_assert(WBXML_STRCMP(wbxml_errors_string(WBXML_ERROR_CHARSET_NOT_FOUND), "Unknown Error Code") != 0);
 }
 END_TEST
 
 START_TEST (test_errors_unknown_error_code)
 {
     ck_assert(wbxml_errors_string(127) != NULL);
-    ck_assert(strcmp(wbxml_errors_string(127), "Unknown Error Code") == 0);
+    ck_assert(WBXML_STRCMP(wbxml_errors_string(127), "Unknown Error Code") == 0);
 }
 END_TEST
 
index 2dd492d4ac777348e7bb7b83642b4f0cc0b4290e..3ee8044be00cbe6498c65c0f56fe1351ab31f110 100644 (file)
@@ -2,7 +2,7 @@
 ENABLE_TESTING()
 CONFIGURE_FILE( "launchTests.sh" "${CMAKE_CURRENT_BINARY_DIR}/launchTests.sh")
 CONFIGURE_FILE( "normalize_xml.pl" "${CMAKE_CURRENT_BINARY_DIR}/normalize_xml.pl" @ONLY)
-SET( activesync_tests 12 )
+SET( activesync_tests 13 )
 SET( airsync_tests 4 )
 SET( ddf_tests 2 )
 # 2009-Jan-19 bellmich
diff --git a/test/tools/activesync/activesync-040-search-response.xml b/test/tools/activesync/activesync-040-search-response.xml
new file mode 100644 (file)
index 0000000..d68123b
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!DOCTYPE ActiveSync PUBLIC "-//MICROSOFT//DTD ActiveSync//EN" "http://www.microsoft.com/">\r
+<Search xmlns="Search:">\r
+ <Status>1</Status>\r
+ <Response>\r
+  <Store>\r
+   <Status>1</Status>\r
+   <Result>\r
+    <Properties>\r
+     <DisplayName xmlns="Gal:">xxx yyy</DisplayName>\r
+     <FirstName xmlns="Gal:">xxx</FirstName>\r
+     <LastName xmlns="Gal:">yyy</LastName>\r
+     <EmailAddress xmlns="Gal:">tfu@aon.at</EmailAddress>\r
+     <Phone xmlns="Gal:">+0 (999) 99999</Phone>\r
+     <HomePhone xmlns="Gal:">++0 (999) 99999</HomePhone>\r
+     <Picture xmlns="Gal:">\r
+      <Status>1</Status>\r
+      <Data>/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgASABgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAA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BUNzKSOPm6ZBwc7T054yCUU1Vvq1+f+YnTvs2vu/yM26h+MB85k1PTAJi2I3kkYLkYG3G08dfvfoMV5r4v+Bvj/wAfa3He65q+jtJGY87hLghDkAk72A5OcYz3zgUUU1Uv0RPI1s2dGPh349QxMupaGZl4MuyQswAx8xZemP07UWngDxIzxy3P/CNOWxl1tWZpBxwflAbp09hmiitlUfZfcczpJdX95//Z</Data>\r
+     </Picture>\r
+    </Properties>\r
+   </Result>\r
+   <Range>0-0</Range>\r
+   <Total>1</Total>\r
+  </Store>\r
+ </Response>\r
+</Search>\r
index b2c4315d935a6c9b242ca62a24bf03da7591c97e..605e178f0acd765ef99fb44106138eff1504e296 100644 (file)
@@ -15,10 +15,18 @@ ELSE( LIBWBXML_POSIX_GETOPT )
 ENDIF( LIBWBXML_POSIX_GETOPT )
 
 ADD_EXECUTABLE( wbxml2xml wbxml2xml_tool.c ${ATTGETOPT} )
+IF(BUILD_SHARED_LIBS)
        TARGET_LINK_LIBRARIES( wbxml2xml wbxml2 )
+ELSE(BUILD_SHARED_LIBS)
+       TARGET_LINK_LIBRARIES( wbxml2xml wbxml2_static )
+ENDIF()
        INSTALL( TARGETS wbxml2xml DESTINATION ${LIBWBXML_BIN_DIR} )
 
 ADD_EXECUTABLE( xml2wbxml xml2wbxml_tool.c ${ATTGETOPT} )
+IF(BUILD_SHARED_LIBS)
        TARGET_LINK_LIBRARIES( xml2wbxml wbxml2 )
+ELSE(BUILD_SHARED_LIBS)
+       TARGET_LINK_LIBRARIES( xml2wbxml wbxml2_static )
+ENDIF()
        INSTALL( TARGETS xml2wbxml DESTINATION ${LIBWBXML_BIN_DIR} )