From 7cc776efa35ba7afe230134ed92bffad764be2ea Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 24 Dec 2021 11:24:33 +0900 Subject: [PATCH] Imported Upstream version 0.11.3 --- AUTHORS | 2 - BUGS | 14 +- CMakeLists.txt | 32 +- COPYING | 5 +- ChangeLog | 28 +- README | 8 +- RELEASE | 13 +- THANKS | 1 + src/wbxml_buffers.c | 82 ++- src/wbxml_buffers.h | 14 +- src/wbxml_charset.c | 2 +- src/wbxml_conv.c | 12 +- src/wbxml_encoder.c | 75 +- src/wbxml_errors.c | 2 +- src/wbxml_handlers.h | 4 +- src/wbxml_lists.c | 13 +- src/wbxml_lists.h | 6 +- src/wbxml_parser.c | 30 +- src/wbxml_tree.c | 9 +- src/wbxml_tree_clb_wbxml.c | 8 +- src/wbxml_tree_clb_wbxml.h | 6 +- src/wbxml_tree_clb_xml.c | 16 +- test/api/CMakeLists.txt | 22 + test/api/api_test.c | 14 + test/api/api_test.h | 16 + test/api/test_wbxml_base64.c | 68 ++ test/api/test_wbxml_buffers.c | 650 ++++++++++++++++++ test/api/test_wbxml_charset.c | 26 + test/api/test_wbxml_conv.c | 18 + test/api/test_wbxml_encoder_internals.c | 29 + test/api/test_wbxml_errors.c | 43 ++ test/api/test_wbxml_lists.c | 156 +++++ test/api/test_wbxml_parser_internals.c | 75 ++ test/tools/CMakeLists.txt | 28 + ...vesync-001-settings_device_information.xml | 0 ...tivesync-002-settings_user_information.xml | 0 ...ctivesync-003-settings_device_password.xml | 0 .../activesync-004-settings_oof.xml | 0 .../activesync-005-settings_status.xml | 0 .../activesync-010-provision-eas.xml | 0 .../activesync-011-provision-wap.xml | 0 ...vesync-020-folder_sync_initial_request.xml | 0 ...esync-021-folder_sync_initial_response.xml | 0 .../activesync-030-sendmail-request.xml | 0 .../activesync-031-sendmail-request.xml | 0 .../activesync-032-formatted-base64.xml | 0 {tests => test/tools}/airsync/airsync-001.xml | 0 .../airsync-002-search_query_for_exchange.xml | 0 ...sync-003-search_response_from_exchange.xml | 0 .../airsync/airsync-004-binary_byte_array.xml | 0 {tests => test/tools}/conml/conml-001.xml | 0 {tests => test/tools}/conml/conml-002.xml | 0 {tests => test/tools}/ddf/ddf-001.ddf | 0 .../tools}/ddf/syncml_with_ddf-001.xml | 0 {tests => test/tools}/drmrel/drmrel-001.xml | 0 {tests => test/tools}/drmrel/drmrel-002.xml | 0 {tests => test/tools}/drmrel/drmrel-003.xml | 0 {tests => test/tools}/emn/emn-001.xml | 0 {tests => test/tools}/emn/emn-002.xml | 0 {tests => test/tools}/emn/emn-003.xml | 0 {tests => test/tools}/emn/emn-004.xml | 0 {tests => test/tools}/emn/emn-005.xml | 0 {tests => test/tools}/emn/emn-006.xml | 0 {tests => test/tools}/emn/emn-007.xml | 0 {tests => test/tools}/emn/emn-008.xml | 0 {tests => test/tools}/emn/emn-009.xml | 0 {tests => test/tools}/emn/emn-010.xml | 0 {tests => test/tools}/emn/emn-011.xml | 0 {tests => test/tools}/emn/emn-012.xml | 0 {tests => test/tools}/emn/emn-013.xml | 0 {tests => test/tools}/emn/emn-014.xml | 0 {tests => test/tools}/emn/emn-015.xml | 0 {tests => test/tools}/emn/emn-016.xml | 0 {tests => test/tools}/emn/emn-017.xml | 0 {tests => test/tools}/launchTests.sh | 6 +- {tests => test/tools}/normalize_xml.pl | 0 {tests => test/tools}/ota/ota-001.xml | 0 {tests => test/tools}/ota/ota-002.xml | 0 {tests => test/tools}/ota/ota-003.xml | 0 {tests => test/tools}/prov/prov-001.xml | 0 {tests => test/tools}/prov/prov-002.xml | 0 {tests => test/tools}/prov/prov-003.xml | 0 {tests => test/tools}/prov/prov-004.xml | 0 {tests => test/tools}/prov/prov-005.xml | 0 {tests => test/tools}/prov/prov-006.xml | 0 {tests => test/tools}/prov/prov-007.xml | 0 {tests => test/tools}/prov/prov-008.xml | 0 {tests => test/tools}/si/si-001.xml | 0 {tests => test/tools}/si/si-002.xml | 0 {tests => test/tools}/si/si-003.xml | 0 {tests => test/tools}/si/si-004.xml | 0 {tests => test/tools}/si/si-005.xml | 0 {tests => test/tools}/si/si-006.xml | 0 {tests => test/tools}/si/si-007.xml | 0 {tests => test/tools}/si/si-008.xml | 0 {tests => test/tools}/si/si-009.xml | 0 {tests => test/tools}/si/si-010.xml | 0 {tests => test/tools}/si/si-011.xml | 0 {tests => test/tools}/si/si-012.xml | 0 {tests => test/tools}/si/si-013.xml | 0 {tests => test/tools}/si/si-014.xml | 0 {tests => test/tools}/si/si-015.xml | 0 {tests => test/tools}/si/si-016.xml | 0 {tests => test/tools}/si/si-017.xml | 0 {tests => test/tools}/si/si-018.xml | 0 {tests => test/tools}/si/si-019.xml | 0 {tests => test/tools}/si/si-020.xml | 0 {tests => test/tools}/si/si-021.xml | 0 {tests => test/tools}/si/si-022.xml | 0 {tests => test/tools}/si/si-023.xml | 0 {tests => test/tools}/si/si-024.xml | 0 {tests => test/tools}/si/si-025.xml | 0 {tests => test/tools}/sl/sl-001.xml | 0 {tests => test/tools}/sl/sl-002.xml | 0 {tests => test/tools}/sl/sl-003.xml | 0 {tests => test/tools}/sl/sl-004.xml | 0 {tests => test/tools}/sl/sl-005.xml | 0 {tests => test/tools}/sl/sl-006.xml | 0 {tests => test/tools}/sl/sl-007.xml | 0 {tests => test/tools}/sl/sl-008.xml | 0 {tests => test/tools}/sl/sl-009.xml | 0 {tests => test/tools}/sl/sl-010.xml | 0 {tests => test/tools}/sl/sl-011.xml | 0 {tests => test/tools}/sl/sl-012.xml | 0 {tests => test/tools}/sl/sl-013.xml | 0 {tests => test/tools}/syncml/syncml-001.xml | 0 {tests => test/tools}/syncml/syncml-002.xml | 0 {tests => test/tools}/syncml/syncml-003.xml | 0 {tests => test/tools}/syncml/syncml-004.xml | 0 {tests => test/tools}/syncml/syncml-005.xml | 0 {tests => test/tools}/syncml/syncml-006.xml | 0 {tests => test/tools}/syncml/syncml-007.xml | 0 {tests => test/tools}/syncml/syncml-008.xml | 0 {tests => test/tools}/syncml/syncml-009.xml | 0 {tests => test/tools}/syncml/syncml-010.xml | 0 {tests => test/tools}/syncml/syncml-011.xml | 0 {tests => test/tools}/syncml/syncml-012.xml | 0 {tests => test/tools}/syncml/syncml-013.xml | 0 {tests => test/tools}/syncml/syncml-014.xml | 0 {tests => test/tools}/testsuite.xml | 0 {tests => test/tools}/wv/wv-001.xml | 0 {tests => test/tools}/wv/wv-002.xml | 0 {tests => test/tools}/wv/wv-003.xml | 0 {tests => test/tools}/wv/wv-004.xml | 0 {tests => test/tools}/wv/wv-005.xml | 0 {tests => test/tools}/wv/wv-006.xml | 0 {tests => test/tools}/wv/wv-007.xml | 0 {tests => test/tools}/wv/wv-008.xml | 0 {tests => test/tools}/wv/wv-009.xml | 0 {tests => test/tools}/wv/wv-010.xml | 0 {tests => test/tools}/wv/wv-011.xml | 0 {tests => test/tools}/wv/wv-012.xml | 0 {tests => test/tools}/wv/wv-013.xml | 0 {tests => test/tools}/wv/wv-014.xml | 0 {tests => test/tools}/wv/wv-015.xml | 0 {tests => test/tools}/wv/wv-016.xml | 0 {tests => test/tools}/wv/wv-017.xml | 0 {tests => test/tools}/wv/wv-018.xml | 0 {tests => test/tools}/wv/wv-019.xml | 0 {tests => test/tools}/wv/wv-020.xml | 0 {tests => test/tools}/wv/wv-021.xml | 0 {tests => test/tools}/wv/wv-022.xml | 0 {tests => test/tools}/wv/wv-023.xml | 0 {tests => test/tools}/wv/wv-024.xml | 0 {tests => test/tools}/wv/wv-025.xml | 0 {tests => test/tools}/wv/wv-026.xml | 0 {tests => test/tools}/wv/wv-027.xml | 0 {tests => test/tools}/wv/wv-028.xml | 0 {tests => test/tools}/wv/wv-029.xml | 0 {tests => test/tools}/wv/wv-030.xml | 0 {tests => test/tools}/wv/wv-031.xml | 0 {tests => test/tools}/wv/wv-032.xml | 0 {tests => test/tools}/wv/wv-033.xml | 0 {tests => test/tools}/wv/wv-034.xml | 0 {tests => test/tools}/wv/wv-035.xml | 0 {tests => test/tools}/wv/wv-036.xml | 0 {tests => test/tools}/wv/wv-037.xml | 0 {tests => test/tools}/wv/wv-038.xml | 0 {tests => test/tools}/wv/wv-039.xml | 0 {tests => test/tools}/wv/wv-040.xml | 0 {tests => test/tools}/wv/wv-041.xml | 0 {tests => test/tools}/wv/wv-042.xml | 0 {tests => test/tools}/wv/wv-043.xml | 0 {tests => test/tools}/wv/wv-044.xml | 0 {tests => test/tools}/wv/wv-045.xml | 0 {tests => test/tools}/wv/wv-046.xml | 0 {tests => test/tools}/wv/wv-047.xml | 0 {tests => test/tools}/wv/wv-048.xml | 0 {tests => test/tools}/wv/wv-049.xml | 0 {tests => test/tools}/wv/wv-050.xml | 0 {tests => test/tools}/wv/wv-051.xml | 0 {tests => test/tools}/wv/wv-052.xml | 0 {tests => test/tools}/wv/wv-053.xml | 0 {tests => test/tools}/wv/wv-054.xml | 0 {tests => test/tools}/wv/wv-055.xml | 0 {tests => test/tools}/wv/wv-056.xml | 0 {tests => test/tools}/wv/wv-057.xml | 0 {tests => test/tools}/wv/wv-058.xml | 0 {tests => test/tools}/wv/wv-059.xml | 0 {tests => test/tools}/wv/wv-060.xml | 0 {tests => test/tools}/wv/wv-061.xml | 0 {tests => test/tools}/wv/wv-062.xml | 0 {tests => test/tools}/wv/wv-063.xml | 0 {tests => test/tools}/wv/wv-064.xml | 0 {tests => test/tools}/wv/wv-065.xml | 0 {tests => test/tools}/wv/wv-066.xml | 0 {tests => test/tools}/wv/wv-067.xml | 0 {tests => test/tools}/wv/wv-068.xml | 0 {tests => test/tools}/wv/wv-069.xml | 0 {tests => test/tools}/wv/wv-070.xml | 0 {tests => test/tools}/wv/wv-071.xml | 0 {tests => test/tools}/wv/wv-072.xml | 0 {tests => test/tools}/wv/wv-073.xml | 0 {tests => test/tools}/wv/wv-074.xml | 0 {tests => test/tools}/wv/wv-075.xml | 0 {tests => test/tools}/wv/wv-076.xml | 0 {tests => test/tools}/wv/wv-077.xml | 0 {tests => test/tools}/wv/wv-078.xml | 0 {tests => test/tools}/wv/wv-079.xml | 0 {tests => test/tools}/wv/wv-080.xml | 0 {tests => test/tools}/wv/wv-081.xml | 0 {tests => test/tools}/wv/wv-082.xml | 0 {tests => test/tools}/wv/wv-083.xml | 0 {tests => test/tools}/wv/wv-084.xml | 0 {tests => test/tools}/wv/wv-085.xml | 0 {tests => test/tools}/wv/wv-086.xml | 0 {tests => test/tools}/wv/wv-087.xml | 0 {tests => test/tools}/wv/wv-088.xml | 0 {tests => test/tools}/wv/wv-089.xml | 0 {tests => test/tools}/wv/wv-090.xml | 0 {tests => test/tools}/wv/wv-091.xml | 0 {tests => test/tools}/wv/wv-092.xml | 0 {tests => test/tools}/wv/wv-093.xml | 0 {tests => test/tools}/wv/wv-094.xml | 0 {tests => test/tools}/wv/wv-095.xml | 0 {tests => test/tools}/wv/wv-096.xml | 0 {tests => test/tools}/wv/wv-097.xml | 0 {tests => test/tools}/wv/wv-098.xml | 0 {tests => test/tools}/wv/wv-099.xml | 0 {tests => test/tools}/wv/wv-100.xml | 0 {tests => test/tools}/wv/wv-101.xml | 0 {tests => test/tools}/wv/wv-102.xml | 0 {tests => test/tools}/wv/wv-103.xml | 0 {tests => test/tools}/wv/wv-104.xml | 0 {tests => test/tools}/wv/wv-105.xml | 0 {tests => test/tools}/wv/wv-106-datetime.xml | 0 {tests => test/tools}/wv/wv-107-datetime.xml | 0 {tests => test/tools}/wv/wv-108-datetime.xml | 0 {tests => test/tools}/wv/wv-109-datetime.xml | 0 {tests => test/tools}/wv/wv-110-datetime.xml | 0 {tests => test/tools}/wv/wv-111-datetime.xml | 0 {tests => test/tools}/wv/wv-112-datetime.xml | 0 {tests => test/tools}/wv/wv-113-datetime.xml | 0 {tests => test/tools}/wv/wv-114-datetime.xml | 0 {tests => test/tools}/wv/wv-115-datetime.xml | 0 {tests => test/tools}/wv/wv-116-datetime.xml | 0 256 files changed, 1376 insertions(+), 157 deletions(-) delete mode 100644 AUTHORS create mode 100644 test/api/CMakeLists.txt create mode 100644 test/api/api_test.c create mode 100644 test/api/api_test.h create mode 100644 test/api/test_wbxml_base64.c create mode 100644 test/api/test_wbxml_buffers.c create mode 100644 test/api/test_wbxml_charset.c create mode 100644 test/api/test_wbxml_conv.c create mode 100644 test/api/test_wbxml_encoder_internals.c create mode 100644 test/api/test_wbxml_errors.c create mode 100644 test/api/test_wbxml_lists.c create mode 100644 test/api/test_wbxml_parser_internals.c create mode 100644 test/tools/CMakeLists.txt rename {tests => test/tools}/activesync/activesync-001-settings_device_information.xml (100%) rename {tests => test/tools}/activesync/activesync-002-settings_user_information.xml (100%) rename {tests => test/tools}/activesync/activesync-003-settings_device_password.xml (100%) rename {tests => test/tools}/activesync/activesync-004-settings_oof.xml (100%) rename {tests => test/tools}/activesync/activesync-005-settings_status.xml (100%) rename {tests => test/tools}/activesync/activesync-010-provision-eas.xml (100%) rename {tests => test/tools}/activesync/activesync-011-provision-wap.xml (100%) rename {tests => test/tools}/activesync/activesync-020-folder_sync_initial_request.xml (100%) rename {tests => test/tools}/activesync/activesync-021-folder_sync_initial_response.xml (100%) rename {tests => test/tools}/activesync/activesync-030-sendmail-request.xml (100%) rename {tests => test/tools}/activesync/activesync-031-sendmail-request.xml (100%) rename {tests => test/tools}/activesync/activesync-032-formatted-base64.xml (100%) rename {tests => test/tools}/airsync/airsync-001.xml (100%) rename {tests => test/tools}/airsync/airsync-002-search_query_for_exchange.xml (100%) rename {tests => test/tools}/airsync/airsync-003-search_response_from_exchange.xml (100%) rename {tests => test/tools}/airsync/airsync-004-binary_byte_array.xml (100%) rename {tests => test/tools}/conml/conml-001.xml (100%) rename {tests => test/tools}/conml/conml-002.xml (100%) rename {tests => test/tools}/ddf/ddf-001.ddf (100%) rename {tests => test/tools}/ddf/syncml_with_ddf-001.xml (100%) rename {tests => test/tools}/drmrel/drmrel-001.xml (100%) rename {tests => test/tools}/drmrel/drmrel-002.xml (100%) rename {tests => test/tools}/drmrel/drmrel-003.xml (100%) rename {tests => test/tools}/emn/emn-001.xml (100%) rename {tests => test/tools}/emn/emn-002.xml (100%) rename {tests => test/tools}/emn/emn-003.xml (100%) rename {tests => test/tools}/emn/emn-004.xml (100%) rename {tests => test/tools}/emn/emn-005.xml (100%) rename {tests => test/tools}/emn/emn-006.xml (100%) rename {tests => test/tools}/emn/emn-007.xml (100%) rename {tests => test/tools}/emn/emn-008.xml (100%) rename {tests => test/tools}/emn/emn-009.xml (100%) rename {tests => test/tools}/emn/emn-010.xml (100%) rename {tests => test/tools}/emn/emn-011.xml (100%) rename {tests => test/tools}/emn/emn-012.xml (100%) rename {tests => test/tools}/emn/emn-013.xml (100%) rename {tests => test/tools}/emn/emn-014.xml (100%) rename {tests => test/tools}/emn/emn-015.xml (100%) rename {tests => test/tools}/emn/emn-016.xml (100%) rename {tests => test/tools}/emn/emn-017.xml (100%) rename {tests => test/tools}/launchTests.sh (96%) rename {tests => test/tools}/normalize_xml.pl (100%) rename {tests => test/tools}/ota/ota-001.xml (100%) rename {tests => test/tools}/ota/ota-002.xml (100%) rename {tests => test/tools}/ota/ota-003.xml (100%) rename {tests => test/tools}/prov/prov-001.xml (100%) rename {tests => test/tools}/prov/prov-002.xml (100%) rename {tests => test/tools}/prov/prov-003.xml (100%) rename {tests => test/tools}/prov/prov-004.xml (100%) rename {tests => test/tools}/prov/prov-005.xml (100%) rename {tests => test/tools}/prov/prov-006.xml (100%) rename {tests => test/tools}/prov/prov-007.xml (100%) rename {tests => test/tools}/prov/prov-008.xml (100%) rename {tests => test/tools}/si/si-001.xml (100%) rename {tests => test/tools}/si/si-002.xml (100%) rename {tests => test/tools}/si/si-003.xml (100%) rename {tests => test/tools}/si/si-004.xml (100%) rename {tests => test/tools}/si/si-005.xml (100%) rename {tests => test/tools}/si/si-006.xml (100%) rename {tests => test/tools}/si/si-007.xml (100%) rename {tests => test/tools}/si/si-008.xml (100%) rename {tests => test/tools}/si/si-009.xml (100%) rename {tests => test/tools}/si/si-010.xml (100%) rename {tests => test/tools}/si/si-011.xml (100%) rename {tests => test/tools}/si/si-012.xml (100%) rename {tests => test/tools}/si/si-013.xml (100%) rename {tests => test/tools}/si/si-014.xml (100%) rename {tests => test/tools}/si/si-015.xml (100%) rename {tests => test/tools}/si/si-016.xml (100%) rename {tests => test/tools}/si/si-017.xml (100%) rename {tests => test/tools}/si/si-018.xml (100%) rename {tests => test/tools}/si/si-019.xml (100%) rename {tests => test/tools}/si/si-020.xml (100%) rename {tests => test/tools}/si/si-021.xml (100%) rename {tests => test/tools}/si/si-022.xml (100%) rename {tests => test/tools}/si/si-023.xml (100%) rename {tests => test/tools}/si/si-024.xml (100%) rename {tests => test/tools}/si/si-025.xml (100%) rename {tests => test/tools}/sl/sl-001.xml (100%) rename {tests => test/tools}/sl/sl-002.xml (100%) rename {tests => test/tools}/sl/sl-003.xml (100%) rename {tests => test/tools}/sl/sl-004.xml (100%) rename {tests => test/tools}/sl/sl-005.xml (100%) rename {tests => test/tools}/sl/sl-006.xml (100%) rename {tests => test/tools}/sl/sl-007.xml (100%) rename {tests => test/tools}/sl/sl-008.xml (100%) rename {tests => test/tools}/sl/sl-009.xml (100%) rename {tests => test/tools}/sl/sl-010.xml (100%) rename {tests => test/tools}/sl/sl-011.xml (100%) rename {tests => test/tools}/sl/sl-012.xml (100%) rename {tests => test/tools}/sl/sl-013.xml (100%) rename {tests => test/tools}/syncml/syncml-001.xml (100%) rename {tests => test/tools}/syncml/syncml-002.xml (100%) rename {tests => test/tools}/syncml/syncml-003.xml (100%) rename {tests => test/tools}/syncml/syncml-004.xml (100%) rename {tests => test/tools}/syncml/syncml-005.xml (100%) rename {tests => test/tools}/syncml/syncml-006.xml (100%) rename {tests => test/tools}/syncml/syncml-007.xml (100%) rename {tests => test/tools}/syncml/syncml-008.xml (100%) rename {tests => test/tools}/syncml/syncml-009.xml (100%) rename {tests => test/tools}/syncml/syncml-010.xml (100%) rename {tests => test/tools}/syncml/syncml-011.xml (100%) rename {tests => test/tools}/syncml/syncml-012.xml (100%) rename {tests => test/tools}/syncml/syncml-013.xml (100%) rename {tests => test/tools}/syncml/syncml-014.xml (100%) rename {tests => test/tools}/testsuite.xml (100%) rename {tests => test/tools}/wv/wv-001.xml (100%) rename {tests => test/tools}/wv/wv-002.xml (100%) rename {tests => test/tools}/wv/wv-003.xml (100%) rename {tests => test/tools}/wv/wv-004.xml (100%) rename {tests => test/tools}/wv/wv-005.xml (100%) rename {tests => test/tools}/wv/wv-006.xml (100%) rename {tests => test/tools}/wv/wv-007.xml (100%) rename {tests => test/tools}/wv/wv-008.xml (100%) rename {tests => test/tools}/wv/wv-009.xml (100%) rename {tests => test/tools}/wv/wv-010.xml (100%) rename {tests => test/tools}/wv/wv-011.xml (100%) rename {tests => test/tools}/wv/wv-012.xml (100%) rename {tests => test/tools}/wv/wv-013.xml (100%) rename {tests => test/tools}/wv/wv-014.xml (100%) rename {tests => test/tools}/wv/wv-015.xml (100%) rename {tests => test/tools}/wv/wv-016.xml (100%) rename {tests => test/tools}/wv/wv-017.xml (100%) rename {tests => test/tools}/wv/wv-018.xml (100%) rename {tests => test/tools}/wv/wv-019.xml (100%) rename {tests => test/tools}/wv/wv-020.xml (100%) rename {tests => test/tools}/wv/wv-021.xml (100%) rename {tests => test/tools}/wv/wv-022.xml (100%) rename {tests => test/tools}/wv/wv-023.xml (100%) rename {tests => test/tools}/wv/wv-024.xml (100%) rename {tests => test/tools}/wv/wv-025.xml (100%) rename {tests => test/tools}/wv/wv-026.xml (100%) rename {tests => test/tools}/wv/wv-027.xml (100%) rename {tests => test/tools}/wv/wv-028.xml (100%) rename {tests => test/tools}/wv/wv-029.xml (100%) rename {tests => test/tools}/wv/wv-030.xml (100%) rename {tests => test/tools}/wv/wv-031.xml (100%) rename {tests => test/tools}/wv/wv-032.xml (100%) rename {tests => test/tools}/wv/wv-033.xml (100%) rename {tests => test/tools}/wv/wv-034.xml (100%) rename {tests => test/tools}/wv/wv-035.xml (100%) rename {tests => test/tools}/wv/wv-036.xml (100%) rename {tests => test/tools}/wv/wv-037.xml (100%) rename {tests => test/tools}/wv/wv-038.xml (100%) rename {tests => test/tools}/wv/wv-039.xml (100%) rename {tests => test/tools}/wv/wv-040.xml (100%) rename {tests => test/tools}/wv/wv-041.xml (100%) rename {tests => test/tools}/wv/wv-042.xml (100%) rename {tests => test/tools}/wv/wv-043.xml (100%) rename {tests => test/tools}/wv/wv-044.xml (100%) rename {tests => test/tools}/wv/wv-045.xml (100%) rename {tests => test/tools}/wv/wv-046.xml (100%) rename {tests => test/tools}/wv/wv-047.xml (100%) rename {tests => test/tools}/wv/wv-048.xml (100%) rename {tests => test/tools}/wv/wv-049.xml (100%) rename {tests => test/tools}/wv/wv-050.xml (100%) rename {tests => test/tools}/wv/wv-051.xml (100%) rename {tests => test/tools}/wv/wv-052.xml (100%) rename {tests => test/tools}/wv/wv-053.xml (100%) rename {tests => test/tools}/wv/wv-054.xml (100%) rename {tests => test/tools}/wv/wv-055.xml (100%) rename {tests => test/tools}/wv/wv-056.xml (100%) rename {tests => test/tools}/wv/wv-057.xml (100%) rename {tests => test/tools}/wv/wv-058.xml (100%) rename {tests => test/tools}/wv/wv-059.xml (100%) rename {tests => test/tools}/wv/wv-060.xml (100%) rename {tests => test/tools}/wv/wv-061.xml (100%) rename {tests => test/tools}/wv/wv-062.xml (100%) rename {tests => test/tools}/wv/wv-063.xml (100%) rename {tests => test/tools}/wv/wv-064.xml (100%) rename {tests => test/tools}/wv/wv-065.xml (100%) rename {tests => test/tools}/wv/wv-066.xml (100%) rename {tests => test/tools}/wv/wv-067.xml (100%) rename {tests => test/tools}/wv/wv-068.xml (100%) rename {tests => test/tools}/wv/wv-069.xml (100%) rename {tests => test/tools}/wv/wv-070.xml (100%) rename {tests => test/tools}/wv/wv-071.xml (100%) rename {tests => test/tools}/wv/wv-072.xml (100%) rename {tests => test/tools}/wv/wv-073.xml (100%) rename {tests => test/tools}/wv/wv-074.xml (100%) rename {tests => test/tools}/wv/wv-075.xml (100%) rename {tests => test/tools}/wv/wv-076.xml (100%) rename {tests => test/tools}/wv/wv-077.xml (100%) rename {tests => test/tools}/wv/wv-078.xml (100%) rename {tests => test/tools}/wv/wv-079.xml (100%) rename {tests => test/tools}/wv/wv-080.xml (100%) rename {tests => test/tools}/wv/wv-081.xml (100%) rename {tests => test/tools}/wv/wv-082.xml (100%) rename {tests => test/tools}/wv/wv-083.xml (100%) rename {tests => test/tools}/wv/wv-084.xml (100%) rename {tests => test/tools}/wv/wv-085.xml (100%) rename {tests => test/tools}/wv/wv-086.xml (100%) rename {tests => test/tools}/wv/wv-087.xml (100%) rename {tests => test/tools}/wv/wv-088.xml (100%) rename {tests => test/tools}/wv/wv-089.xml (100%) rename {tests => test/tools}/wv/wv-090.xml (100%) rename {tests => test/tools}/wv/wv-091.xml (100%) rename {tests => test/tools}/wv/wv-092.xml (100%) rename {tests => test/tools}/wv/wv-093.xml (100%) rename {tests => test/tools}/wv/wv-094.xml (100%) rename {tests => test/tools}/wv/wv-095.xml (100%) rename {tests => test/tools}/wv/wv-096.xml (100%) rename {tests => test/tools}/wv/wv-097.xml (100%) rename {tests => test/tools}/wv/wv-098.xml (100%) rename {tests => test/tools}/wv/wv-099.xml (100%) rename {tests => test/tools}/wv/wv-100.xml (100%) rename {tests => test/tools}/wv/wv-101.xml (100%) rename {tests => test/tools}/wv/wv-102.xml (100%) rename {tests => test/tools}/wv/wv-103.xml (100%) rename {tests => test/tools}/wv/wv-104.xml (100%) rename {tests => test/tools}/wv/wv-105.xml (100%) rename {tests => test/tools}/wv/wv-106-datetime.xml (100%) rename {tests => test/tools}/wv/wv-107-datetime.xml (100%) rename {tests => test/tools}/wv/wv-108-datetime.xml (100%) rename {tests => test/tools}/wv/wv-109-datetime.xml (100%) rename {tests => test/tools}/wv/wv-110-datetime.xml (100%) rename {tests => test/tools}/wv/wv-111-datetime.xml (100%) rename {tests => test/tools}/wv/wv-112-datetime.xml (100%) rename {tests => test/tools}/wv/wv-113-datetime.xml (100%) rename {tests => test/tools}/wv/wv-114-datetime.xml (100%) rename {tests => test/tools}/wv/wv-115-datetime.xml (100%) rename {tests => test/tools}/wv/wv-116-datetime.xml (100%) diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index d034612..0000000 --- a/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Main Developper: -Aymerick Jehanne \ No newline at end of file diff --git a/BUGS b/BUGS index 88a01a7..f6c0466 100644 --- a/BUGS +++ b/BUGS @@ -1,18 +1,10 @@ 1. Please read the TODO file for the limitations of the library. -2. Please register to our ticket system (Trac): +2. Open an issue at GitHub: -https://libwbxml.opensync.org/register +https://github.com/libwbxml/libwbxml/issues -3. Please check for an open/active ticket: - -https://libwbxml.opensync.org/report/1 - -4. Please create a new ticket: - -https://libwbxml.opensync.org/newticket - -Please note that a ticket is the most reliable way of communication. +Please note that an issue is the most reliable way of communication. If emails are ignored then a ticket still persists. The tickets are checked before every release at minimum. diff --git a/CMakeLists.txt b/CMakeLists.txt index 96bbf63..c98f9b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT( libwbxml C ) SET( LIBWBXML_VERSION_MAJOR "0" ) SET( LIBWBXML_VERSION_MINOR "11" ) -SET( LIBWBXML_VERSION_PATCH "2" ) +SET( LIBWBXML_VERSION_PATCH "3" ) IF( LIBWBXML_VERSION_BETA ) IF( LIBWBXML_VERSION_BETA VERSION_GREATER 90 ) MATH( EXPR LIBWBXML_VERSION_MINOR "${LIBWBXML_VERSION_MINOR} - 1" ) @@ -23,7 +23,7 @@ SET( LIBWBXML_LIBVERSION_CURRENT 1 ) # UPDATE: last release. # UPDATE: Set REVISION to 0 if any interface have been added, removed or # UPDATE: changed since the last update. -SET( LIBWBXML_LIBVERSION_REVISION 4 ) +SET( LIBWBXML_LIBVERSION_REVISION 5 ) # The difference between the newest and the oldest interfaces. # UPDATE: If any interface have been added since the last public @@ -261,29 +261,5 @@ INCLUDE( CPack ) ### CTest ######################################## -ENABLE_TESTING() -CONFIGURE_FILE( "tests/launchTests.sh" "${CMAKE_CURRENT_BINARY_DIR}/launchTests.sh") -CONFIGURE_FILE( "tests/normalize_xml.pl" "${CMAKE_CURRENT_BINARY_DIR}/normalize_xml.pl" @ONLY) -SET( activesync_tests 12 ) -SET( airsync_tests 4 ) -SET( ddf_tests 2 ) -# 2009-Jan-19 bellmich -# All DRMREL 1.0 tests are switched off. -# The background is the extremely bad specification. -# DRMREL 1.0 hardcodes the XML namespace translation. -# I never saw such a broken XML design before. -# -#SET( drmrel_tests 3 ) -SET( emn_tests 17 ) -SET( ota_tests 3 ) -SET( prov_tests 8 ) -SET( si_tests 25 ) -SET( sl_tests 13 ) -SET( syncml_tests 14 ) -SET( wv_tests 116 ) -SET( conml_tests 2 ) -FOREACH( TESTDIR activesync airsync conml ddf emn ota prov si sl syncml wv ) - FOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) - ADD_TEST( "${TESTDIR}_${ITEM}" launchTests.sh "${CMAKE_SOURCE_DIR}/tests" "${TESTDIR}" ${ITEM} ) - ENDFOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) -ENDFOREACH( TESTDIR activesync airsync conml ddf emn ota prov si sl syncml wv ) +ADD_SUBDIRECTORY( test/tools ) +ADD_SUBDIRECTORY( test/api ) diff --git a/COPYING b/COPYING index 89e5cc1..ecef2e3 100644 --- a/COPYING +++ b/COPYING @@ -20,5 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA LGPL v2.1: http://www.gnu.org/copyleft/lesser.txt -Contact: opensync-users@lists.sf.net -Home: http://libwbxml.opensync.org +Home: https://github.com/libwbxml/libwbxml + +Contact: https://github.com/libwbxml/libwbxml/issues diff --git a/ChangeLog b/ChangeLog index 04d300b..1d9a29e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,29 @@ +2015-04-07 Michael Bell + * Released 0.11.3 + * Migrated the sources to github + * Replaced the references to the degraded OpenSync infrastructure + * Introduced a single test directory. + * Added the first test suite for a private API - src/wbxml_lists.h. + This includes a frame work for such test suites. + * Added a sanity check to make some tools happy in + wbxml_strtbl_collect_strings in src/wbxml_encoder.c. + The patch was supplied by Gaurav Gupta from Samsung. + * Fixed a memory leak of wbxml_tree_clb_xml_end_element in + src/wbxml_tree_clb_xml.c. + The patch was supplied by Gaurav Gupta from Samsung. + * Added some sanity checks to detect the wrong usage of + wbxml_fill_header in src/wbxml_encoder.c. + The patch was supplied by Gaurav Gupta from Samsung. + * The code of the function wbxml_tree_clb_xml_end_element to handle + binary tags used variables which were only defined if the SyncML + code is enabled. The file wbxml_tree_clb_xml.c was fixed + (ticket #85). + 2012-07-20 Michael Bell - * libwbxml2.pc only depends on expat. It does not depend on libxml2. - The cmake module was fixed too. - * Install FindLibWbxml2.cmake during "make install" (ticket #83). + * Released 0.11.2 + * libwbxml2 only depends on expat. It does not depend on libxml2. + The pkgconfig file and the cmake module were fixed. + * FindLibWbxml2.cmake is installed during "make install" (ticket #83). The external cmake modules are now included at cmake/modules because the cmake directory includes a CMakeLists.txt. * Removed outdated test/test_parser.c (ticket #82). diff --git a/README b/README index e34f9a9..18f3c44 100644 --- a/README +++ b/README @@ -147,5 +147,9 @@ CONTACT: -------- - OpenSync mailing list - http://libwbxml.opensync.org + Please use GitHub to report bugs, ask questions or submit code: + https://github.com/libwbxml/libwbxml + + Releases can be found on Sourceforge too: + https://sourceforge.net/projects/libwbxml/ + diff --git a/RELEASE b/RELEASE index ea058eb..9a973ea 100644 --- a/RELEASE +++ b/RELEASE @@ -3,7 +3,7 @@ Making a release To make a release of libwbxml, do the following: - - check out a fresh copy from subversion + - check out a fresh copy from github - increment the version numbers in ./CMakeLists.txt: @@ -32,16 +32,15 @@ To make a release of libwbxml, do the following: "make" "make test" - - Commit the increased version changes (and build fixes) + - Commit and push the increased version changes (and build fixes) - - if someone else made changes and the commit fails, - you have to "svn up" and run the tests again + - if someone else made changes and the push fails, + you have to "git pull" and run the tests again - - please run "svn status" before you continue to be 100 percent sure + - please run "git status" before you continue to be 100 percent sure that there is no forgotten commit and no unrevisioned file. - - please run 'find . -name "svn-commit*.tmp" -print' to detect - waste from failed commits. + - Check ChangeLog to be complete and add the new release name. - once the commit succeeds, you have to create a new tag with "mkdir tags/libwbxml-$MAJOR.$MINOR.$PATCH", diff --git a/THANKS b/THANKS index 8b883fb..41f2522 100644 --- a/THANKS +++ b/THANKS @@ -12,6 +12,7 @@ Amnon Aaronsohn (ActiveSync) Pau Aliagas Michael Banck (Debian package maintainer, testing) Michael Bell +Gaurav Gupta Conrad Irwin (performance fixes) Aymerick Jehanne Ossi Jormakka (Ixonos Plc., ActiveSync) diff --git a/src/wbxml_buffers.c b/src/wbxml_buffers.c index c764ad4..bc9a19d 100644 --- a/src/wbxml_buffers.c +++ b/src/wbxml_buffers.c @@ -166,7 +166,7 @@ WBXML_DECLARE(WB_ULONG) wbxml_buffer_len(WBXMLBuffer *buffer) WBXML_DECLARE(WB_BOOL) wbxml_buffer_get_char(WBXMLBuffer *buffer, WB_ULONG pos, WB_UTINY *result) { - if ((buffer == NULL) || (pos >= buffer->len)) + if ((buffer == NULL) || (pos >= buffer->len) || (result == NULL)) return FALSE; *result = buffer->data[pos]; @@ -174,10 +174,14 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_get_char(WBXMLBuffer *buffer, WB_ULONG pos, } -WBXML_DECLARE(void) wbxml_buffer_set_char(WBXMLBuffer *buffer, WB_ULONG pos, WB_UTINY ch) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_set_char(WBXMLBuffer *buffer, WB_ULONG pos, WB_UTINY ch) { - if ((buffer != NULL) && !buffer->is_static && (pos < buffer->len)) - buffer->data[pos] = ch; + if ((buffer == NULL) || (buffer->is_static) || (pos >= buffer->len)) + return FALSE; + + buffer->data[pos] = ch; + + return TRUE; } @@ -199,7 +203,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert(WBXMLBuffer *to, WBXMLBuffer *buffer, } -WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert_cstr(WBXMLBuffer *to, WB_UTINY *str, WB_ULONG pos) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert_cstr(WBXMLBuffer *to, const WB_UTINY *str, WB_ULONG pos) { if ((to != NULL) && (str != NULL) && !to->is_static) return insert_data(to, pos, str, WBXML_STRLEN(str)); @@ -284,34 +288,31 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_append_mb_uint_32(WBXMLBuffer *buffer, WB_UL } -WBXML_DECLARE(void) wbxml_buffer_delete(WBXMLBuffer *buffer, WB_ULONG pos, WB_ULONG len) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_delete(WBXMLBuffer *buffer, WB_ULONG pos, WB_ULONG len) { - if ((buffer == NULL) || buffer->is_static) - return; + if ((buffer == NULL) || (buffer->is_static)) + return FALSE; - if (pos > buffer->len) - pos = buffer->len; - - if (pos + len > buffer->len) - len = buffer->len - pos; - - if (len > 0) { - memmove(buffer->data + pos, buffer->data + pos + len, - buffer->len - pos - len); + if ((pos >= buffer->len) || (len <= 0)) + return FALSE; + + memmove(buffer->data + pos, buffer->data + pos + len, + buffer->len - pos - len); - buffer->len -= len; - buffer->data[buffer->len] = '\0'; - } + buffer->len -= len; + buffer->data[buffer->len] = '\0'; + + return TRUE; } -WBXML_DECLARE(void) wbxml_buffer_shrink_blanks(WBXMLBuffer *buffer) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_shrink_blanks(WBXMLBuffer *buffer) { WB_ULONG i = 0, j = 0, end = 0; WB_UTINY ch = 0; if ((buffer == NULL) || buffer->is_static) - return; + return FALSE; end = wbxml_buffer_len(buffer); @@ -332,16 +333,18 @@ WBXML_DECLARE(void) wbxml_buffer_shrink_blanks(WBXMLBuffer *buffer) wbxml_buffer_delete(buffer, i, j - i); } } + + return TRUE; } -WBXML_DECLARE(void) wbxml_buffer_strip_blanks(WBXMLBuffer *buffer) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_strip_blanks(WBXMLBuffer *buffer) { WB_ULONG start = 0, end = 0, len = 0; WB_UTINY ch = 0; if ((buffer == NULL) || buffer->is_static) - return; + return FALSE; /* Remove whitespaces at beginning of buffer... */ while (wbxml_buffer_get_char(buffer, start, &ch) && @@ -364,6 +367,8 @@ WBXML_DECLARE(void) wbxml_buffer_strip_blanks(WBXMLBuffer *buffer) } wbxml_buffer_delete(buffer, end + 1, len - end); } + + return TRUE; } WBXML_DECLARE(void) wbxml_buffer_no_spaces(WBXMLBuffer *buffer) @@ -476,6 +481,9 @@ WBXML_DECLARE(WBXMLList *) wbxml_buffer_split_words_real(WBXMLBuffer *buff) WBXMLBuffer *word = NULL; WB_ULONG i = 0, start = 0, end = 0; + if (buff == NULL) + return NULL; + if ((list = wbxml_list_create()) == NULL) return NULL; @@ -626,13 +634,13 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_contains_only_whitespaces(WBXMLBuffer *buffe } -WBXML_DECLARE(void) wbxml_buffer_hex_to_binary(WBXMLBuffer *buffer) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_hex_to_binary(WBXMLBuffer *buffer) { WB_UTINY *p = NULL; WB_ULONG i = 0, len = 0; if ((buffer == NULL) || buffer->is_static) - return; + return FALSE; p = buffer->data; len = wbxml_buffer_len(buffer); @@ -659,6 +667,8 @@ WBXML_DECLARE(void) wbxml_buffer_hex_to_binary(WBXMLBuffer *buffer) buffer->len = len; buffer->data[len] = '\0'; + + return TRUE; } @@ -699,7 +709,7 @@ WBXML_DECLARE(WBXMLError) wbxml_buffer_decode_base64(WBXMLBuffer *buffer) WB_LONG len = 0; WBXMLError ret = WBXML_OK; - if (buffer == NULL) { + if ( (buffer == NULL) || (buffer->is_static) ) { return WBXML_ERROR_INTERNAL; } @@ -729,7 +739,7 @@ WBXML_DECLARE(WBXMLError) wbxml_buffer_encode_base64(WBXMLBuffer *buffer) WB_UTINY *result = NULL; WBXMLError ret = WBXML_OK; - if (buffer == NULL) { + if ( (buffer == NULL) || (buffer->is_static) ) { return WBXML_ERROR_INTERNAL; } @@ -752,19 +762,21 @@ WBXML_DECLARE(WBXMLError) wbxml_buffer_encode_base64(WBXMLBuffer *buffer) return ret; } -WBXML_DECLARE(void) wbxml_buffer_remove_trailing_zeros(WBXMLBuffer **buffer) +WBXML_DECLARE(WB_BOOL) wbxml_buffer_remove_trailing_zeros(WBXMLBuffer *buffer) { WB_UTINY ch = 0; - if ((buffer == NULL) || (*buffer == NULL)) - return; + if ((buffer == NULL) || (buffer->is_static)) + return FALSE; - while ((*buffer)->len > 0) { - if (wbxml_buffer_get_char(*buffer, wbxml_buffer_len(*buffer) - 1, &ch) && (ch == '\0')) - wbxml_buffer_delete(*buffer, wbxml_buffer_len(*buffer) - 1, 1); + while (buffer->len > 0) { + if (wbxml_buffer_get_char(buffer, wbxml_buffer_len(buffer) - 1, &ch) && (ch == '\0')) + wbxml_buffer_delete(buffer, wbxml_buffer_len(buffer) - 1, 1); else - return; + return TRUE; } + + return TRUE; } diff --git a/src/wbxml_buffers.h b/src/wbxml_buffers.h index f20f48a..3026447 100644 --- a/src/wbxml_buffers.h +++ b/src/wbxml_buffers.h @@ -139,7 +139,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_get_char(WBXMLBuffer *buff, WB_ULONG pos, WB * @param pos Byte position in buffer * @param ch The character to set */ -WBXML_DECLARE(void) wbxml_buffer_set_char(WBXMLBuffer *buff, WB_ULONG pos, WB_UTINY ch); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_set_char(WBXMLBuffer *buff, WB_ULONG pos, WB_UTINY ch); /** * @brief Get pointer to internal buffer data @@ -164,7 +164,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert(WBXMLBuffer *to, WBXMLBuffer *buff, W * @param pos The position of insertion in 'to' * @return TRUE if data inserted, FALSE otherwise */ -WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert_cstr(WBXMLBuffer *to, WB_UTINY *str, WB_ULONG pos); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_insert_cstr(WBXMLBuffer *to, const WB_UTINY *str, WB_ULONG pos); /** * @brief Append a Buffer to a dynamic Buffer @@ -221,20 +221,20 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_append_mb_uint_32(WBXMLBuffer *buff, WB_ULON * @param pos Position where to start deletion * @param len Number of bytes to delete */ -WBXML_DECLARE(void) wbxml_buffer_delete(WBXMLBuffer *buff, WB_ULONG pos, WB_ULONG len); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_delete(WBXMLBuffer *buff, WB_ULONG pos, WB_ULONG len); /** * @brief Shrink all spaces in a dynamicBuffer * @param buff The Buffer to shrink * @note Replace every consecutive sequence of spaces into one unique whitespace */ -WBXML_DECLARE(void) wbxml_buffer_shrink_blanks(WBXMLBuffer *buff); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_shrink_blanks(WBXMLBuffer *buff); /** * @brief Remove whitespaces at beginning and end of a dynamic Buffer * @param buff The Buffer to strip */ -WBXML_DECLARE(void) wbxml_buffer_strip_blanks(WBXMLBuffer *buff); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_strip_blanks(WBXMLBuffer *buff); /** * @brief Compare two Buffers @@ -302,7 +302,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_contains_only_whitespaces(WBXMLBuffer *buffe * @brief Convert an Hexa dynamic buffer to Binary * @param buffer The buffer to convert */ -WBXML_DECLARE(void) wbxml_buffer_hex_to_binary(WBXMLBuffer *buffer); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_hex_to_binary(WBXMLBuffer *buffer); /** * @brief Convert an Binary dynamic buffer to Hexa @@ -330,7 +330,7 @@ WBXML_DECLARE(WBXMLError) wbxml_buffer_encode_base64(WBXMLBuffer *buffer); * @brief Remove trailing Zeros from a dynamic Buffer * @param buffer The buffer */ -WBXML_DECLARE(void) wbxml_buffer_remove_trailing_zeros(WBXMLBuffer **buffer); +WBXML_DECLARE(WB_BOOL) wbxml_buffer_remove_trailing_zeros(WBXMLBuffer *buffer); /** @} */ diff --git a/src/wbxml_charset.c b/src/wbxml_charset.c index 174d22b..8adfde1 100644 --- a/src/wbxml_charset.c +++ b/src/wbxml_charset.c @@ -220,7 +220,7 @@ WBXML_DECLARE(WBXMLError) wbxml_charset_conv(const WB_TINY *in_buf, } /* Remove trailing NULL char */ - wbxml_buffer_remove_trailing_zeros(out_buf); + wbxml_buffer_remove_trailing_zeros(*out_buf); } else { diff --git a/src/wbxml_conv.c b/src/wbxml_conv.c index d436e82..b1a0b4d 100644 --- a/src/wbxml_conv.c +++ b/src/wbxml_conv.c @@ -64,8 +64,12 @@ struct WBXMLConvXML2WBXML_s { WBXML_DECLARE(WBXMLError) wbxml_conv_wbxml2xml_create(WBXMLConvWBXML2XML **conv) { - *conv = (WBXMLConvWBXML2XML *) wbxml_malloc(sizeof(WBXMLConvWBXML2XML)); if (conv == NULL) { + return WBXML_ERROR_BAD_PARAMETER; + } + + *conv = (WBXMLConvWBXML2XML *) wbxml_malloc(sizeof(WBXMLConvWBXML2XML)); + if (*conv == NULL) { return WBXML_ERROR_NOT_ENOUGH_MEMORY; } @@ -208,8 +212,12 @@ WBXML_DECLARE(void) wbxml_conv_wbxml2xml_destroy(WBXMLConvWBXML2XML *conv) */ WBXML_DECLARE(WBXMLError) wbxml_conv_xml2wbxml_create(WBXMLConvXML2WBXML **conv) { - *conv = (WBXMLConvXML2WBXML *) wbxml_malloc(sizeof(WBXMLConvXML2WBXML)); if (conv == NULL) { + return WBXML_ERROR_BAD_PARAMETER; + } + + *conv = (WBXMLConvXML2WBXML *) wbxml_malloc(sizeof(WBXMLConvXML2WBXML)); + if (*conv == NULL) { return WBXML_ERROR_NOT_ENOUGH_MEMORY; } diff --git a/src/wbxml_encoder.c b/src/wbxml_encoder.c index 2eb9be6..a6e442e 100644 --- a/src/wbxml_encoder.c +++ b/src/wbxml_encoder.c @@ -1139,6 +1139,7 @@ static WBXMLError parse_element(WBXMLEncoder *encoder, WBXMLTreeNode *node, WB_B { WB_ULONG i = 0; WBXMLError ret = WBXML_OK; + WBXMLAttribute *attr = NULL; WBXML_DEBUG((WBXML_ENCODER, "Element: <%s>", wbxml_tag_get_xml_name(node->name))); @@ -1167,7 +1168,10 @@ static WBXMLError parse_element(WBXMLEncoder *encoder, WBXMLTreeNode *node, WB_B { for (i = 0; i < wbxml_list_len(node->attrs); i++) { /* Parse: Attribute */ - if ((ret = parse_attribute(encoder, wbxml_list_get(node->attrs, i))) != WBXML_OK) + attr = wbxml_list_get(node->attrs, i); + if (attr == NULL) + return WBXML_ERROR_INTERNAL; + if ((ret = parse_attribute(encoder, attr)) != WBXML_OK) return ret; } } @@ -1500,13 +1504,15 @@ static WBXMLError wbxml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) #if defined( WBXML_ENCODER_USE_STRTBL ) WBXMLStringTableElement *elt = NULL; WB_BOOL added = FALSE; - - strstbl_len = encoder->strstbl_len; #endif /* WBXML_ENCODER_USE_STRTBL */ if ((encoder == NULL) || (encoder->lang == NULL) || (encoder->lang->publicID == NULL) || (header == NULL)) return WBXML_ERROR_BAD_PARAMETER; +#if defined( WBXML_ENCODER_USE_STRTBL ) + strstbl_len = encoder->strstbl_len; +#endif /* WBXML_ENCODER_USE_STRTBL */ + /* WBXML Public ID */ public_id = encoder->lang->publicID->wbxmlPublicID; @@ -1514,7 +1520,7 @@ static WBXMLError wbxml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) if (!wbxml_buffer_append_char(header, (WB_UTINY) encoder->wbxml_version)) return WBXML_ERROR_ENCODER_APPEND_DATA; - /* Encode Public ID */ + /* Prepare string table - adding Public ID */ /* If WBXML Public Id is '0x01' (unknown), or we forced it, add the XML Public ID in the String Table */ if ((encoder->textual_publicid || (public_id == WBXML_PUBLIC_ID_UNKNOWN)) && !encoder->produce_anonymous) @@ -1542,9 +1548,13 @@ static WBXMLError wbxml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) &added)) { wbxml_strtbl_element_destroy(elt); + if (pid) wbxml_buffer_destroy(pid); return WBXML_ERROR_NOT_ENOUGH_MEMORY; } + /* "added" means that pid was consumed by encoder. + * So never free pid if added is TRUE. + */ if (!added) wbxml_strtbl_element_destroy(elt); @@ -1565,19 +1575,23 @@ static WBXMLError wbxml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) } } + /* Encode Public ID */ /* publicid = mb_u_int32 | ( zero index ) */ if (pi_in_strtbl) { /* Encode XML Public ID String Table index */ if (!wbxml_buffer_append_char(header, 0x00) || !wbxml_buffer_append_mb_uint_32(header, public_id_index)) { + if (pid && !added) wbxml_buffer_destroy(pid); return WBXML_ERROR_NOT_ENOUGH_MEMORY; } } else { /* Encode WBXML Public ID */ if (!wbxml_buffer_append_mb_uint_32(header, public_id)) + { return WBXML_ERROR_ENCODER_APPEND_DATA; + } } /* Encode Charset (default: UTF-8) and String Table Length */ @@ -1585,31 +1599,43 @@ static WBXMLError wbxml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) if (!wbxml_buffer_append_mb_uint_32(header, WBXML_ENCODER_DEFAULT_CHARSET) || !wbxml_buffer_append_mb_uint_32(header, strstbl_len)) { + if (pid && !added) wbxml_buffer_destroy(pid); return WBXML_ERROR_ENCODER_APPEND_DATA; } - /* Copy WBXML String Table */ + /* Encode WBXML String Table */ #if defined( WBXML_ENCODER_USE_STRTBL ) if (encoder->use_strtbl) { if ((ret = wbxml_strtbl_construct(header,(WBXMLList *) encoder->strstbl)) != WBXML_OK) + { + if (pid && !added) wbxml_buffer_destroy(pid); return ret; + } } else { #endif /* WBXML_ENCODER_USE_STRTBL */ if (pid != NULL) { if (!wbxml_buffer_append(header, pid)) + { + wbxml_buffer_destroy(pid); return WBXML_ERROR_ENCODER_APPEND_DATA; + } if (!wbxml_buffer_append_char(header, WBXML_STR_END)) + { + wbxml_buffer_destroy(pid); return WBXML_ERROR_ENCODER_APPEND_DATA; + } /* Clean up */ wbxml_buffer_destroy(pid); + pid = NULL; } #if defined( WBXML_ENCODER_USE_STRTBL ) } + if (pid && !added) wbxml_buffer_destroy(pid); #endif /* WBXML_ENCODER_USE_STRTBL */ return WBXML_OK; @@ -2742,7 +2768,7 @@ static WBXMLError wbxml_encode_datetime(WBXMLEncoder *encoder, WB_UTINY *buffer) wbxml_buffer_hex_to_binary(tmp); /* Remove trailing zero */ - wbxml_buffer_remove_trailing_zeros(&tmp); + wbxml_buffer_remove_trailing_zeros(tmp); /* Encode it to Opaque */ ret = wbxml_encode_opaque(encoder, tmp); @@ -3413,15 +3439,24 @@ static WBXMLError wbxml_encode_drmrel_content(WBXMLEncoder *encoder, WB_UTINY *b /* Add WBXML_OPAQUE */ if (!wbxml_buffer_append_char(encoder->output, WBXML_OPAQUE)) + { + wbxml_free(data); return WBXML_ERROR_ENCODER_APPEND_DATA; + } /* Add Data Length */ if (!wbxml_buffer_append_mb_uint_32(encoder->output, (WB_ULONG) data_len)) + { + wbxml_free(data); return WBXML_ERROR_ENCODER_APPEND_DATA; + } /* Add Data */ if (!wbxml_buffer_append_data(encoder->output, data, data_len)) + { + wbxml_free(data); return WBXML_ERROR_ENCODER_APPEND_DATA; + } /* Free Data */ wbxml_free(data); @@ -3663,7 +3698,7 @@ static void wbxml_strtbl_collect_strings(WBXMLEncoder *encoder, WBXMLTreeNode *n attr = wbxml_list_get(node->attrs, i); /* Only add this string if it is big enought */ - if (wbxml_buffer_len(attr->value) > WBXML_ENCODER_STRING_TABLE_MIN) { + if (attr && wbxml_buffer_len(attr->value) > WBXML_ENCODER_STRING_TABLE_MIN) { /* This mustn't be a tokenisable Attribute Start */ attr_entry = wbxml_tables_get_attr_from_xml(encoder->lang, (WB_UTINY *) wbxml_attribute_get_xml_name(attr), @@ -3721,6 +3756,12 @@ static WBXMLError wbxml_strtbl_collect_words(WBXMLList *elements, WBXMLList **re for (i = 0; i < wbxml_list_len(elements); i++) { elt = (WBXMLStringTableElement *) wbxml_list_get(elements, i); + if (elt == NULL) { + /* There is a bug inside the wbxml strtbl implementation. + wbxml_list must be used in a wrong way. + */ + return WBXML_ERROR_INTERNAL; + } if (list == NULL) { if ((list = wbxml_buffer_split_words(elt->string)) == NULL) { @@ -3821,6 +3862,16 @@ static WBXMLError wbxml_strtbl_check_references(WBXMLEncoder *encoder, WBXMLList for (j = 0; j < wbxml_list_len(referenced); j++) { ref = (WBXMLStringTableElement *) wbxml_list_get(referenced, j); + if (ref == NULL) + { + /* There is a bug inside wbxml_strtbl_check_references. + wbxml_list must be used in a wrong way. + */ + if (!stat_buff) + wbxml_buffer_destroy(string); + string = NULL; + return WBXML_ERROR_INTERNAL; + } if (wbxml_buffer_compare(ref->string, string) == 0) { @@ -3990,9 +4041,13 @@ static WBXMLError xml_build_result(WBXMLEncoder *encoder, WB_UTINY **xml, WB_ULO WBXMLBuffer *header = NULL; WB_ULONG len = 0; WBXMLError ret = WBXML_OK; + + if (xml == NULL) + return WBXML_ERROR_BAD_PARAMETER; /* Init */ - *xml_len = 0; + if (xml_len != NULL) + *xml_len = 0; if (encoder->flow_mode == TRUE) { /* Header already built */ @@ -4075,6 +4130,10 @@ static WBXMLError xml_fill_header(WBXMLEncoder *encoder, WBXMLBuffer *header) if (!wbxml_buffer_append_cstr(header, WBXML_ENCODER_XML_DOCTYPE)) return WBXML_ERROR_ENCODER_APPEND_DATA; + /* Check that the language is set */ + if (encoder->lang == NULL) + return WBXML_ERROR_LANG_TABLE_UNDEFINED; + /* Root Element */ if (!wbxml_buffer_append_cstr(header, encoder->lang->publicID->xmlRootElt)) return WBXML_ERROR_ENCODER_APPEND_DATA; diff --git a/src/wbxml_errors.c b/src/wbxml_errors.c index bfecd31..3844282 100644 --- a/src/wbxml_errors.c +++ b/src/wbxml_errors.c @@ -54,7 +54,7 @@ static const WBXMLErrorCodeItem error_table [] = { { WBXML_OK, "No Error" }, { WBXML_NOT_ENCODED, "Not Encoded" }, { WBXML_ERROR_ATTR_TABLE_UNDEFINED, "Attribute Table Undefined" }, - { WBXML_ERROR_BAD_DATETIME, "Bad %Datetime Format" }, + { WBXML_ERROR_BAD_DATETIME, "Bad Datetime Format" }, { WBXML_ERROR_BAD_PARAMETER, "Bad Parameter" }, { WBXML_ERROR_INTERNAL, "Internal Error" }, { WBXML_ERROR_LANG_TABLE_UNDEFINED, "Languages Table Undefined" }, diff --git a/src/wbxml_handlers.h b/src/wbxml_handlers.h index af3dd7c..e282e3d 100644 --- a/src/wbxml_handlers.h +++ b/src/wbxml_handlers.h @@ -69,7 +69,7 @@ typedef void (*WBXMLEndDocumentHandler)(void *ctx); * @param atts The attributes attached to the element * @param empty Set to TRUE if this is an empty element */ -typedef void (*WBXMLStartElementHandler)(void *ctx, WBXMLTag *localName, WBXMLAttribute **atts, WB_BOOL empty); +typedef void (*WBXMLStartElementHandler)(void *ctx, WBXMLTag *localName, WBXMLAttribute **atts); /** * @brief End Element handler @@ -77,7 +77,7 @@ typedef void (*WBXMLStartElementHandler)(void *ctx, WBXMLTag *localName, WBXMLAt * @param localName The local tag name * @param empty Set to TRUE if this is an empty element */ -typedef void (*WBXMLEndElementHandler)(void *ctx, WBXMLTag *localName, WB_BOOL empty); +typedef void (*WBXMLEndElementHandler)(void *ctx, WBXMLTag *localName); /** * @brief Characters handler diff --git a/src/wbxml_lists.c b/src/wbxml_lists.c index 2e8bbbc..c378e68 100644 --- a/src/wbxml_lists.c +++ b/src/wbxml_lists.c @@ -1,7 +1,7 @@ /* * libwbxml, the WBXML Library. * Copyright (C) 2002-2008 Aymerick Jehanne - * Copyright (C) 2011 Michael Bell + * Copyright (C) 2011,2014 Michael Bell * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -110,6 +110,9 @@ WBXML_DECLARE(WB_BOOL) wbxml_list_append(WBXMLList *list, void *item) if (list == NULL) return FALSE; + if (item == NULL) + return FALSE; + if (list->head == NULL) { /* Empty list */ if ((list->head = wbxml_elt_create(item)) == NULL) @@ -139,6 +142,9 @@ WBXML_DECLARE(WB_BOOL) wbxml_list_insert(WBXMLList *list, void *item, WB_ULONG p if (list == NULL) return FALSE; + if (item == NULL) + return FALSE; + if ((new_elt = wbxml_elt_create(item)) == NULL) return FALSE; @@ -216,7 +222,7 @@ WBXML_DECLARE(void *) wbxml_list_extract_first(WBXMLList *list) wbxml_elt_destroy(elt, NULL); list->len--; - + return result; } @@ -235,6 +241,9 @@ static WBXMLListElt *wbxml_elt_create_real(void *item) { WBXMLListElt *elt = NULL; + if (item == NULL) + return NULL; + if ((elt = (WBXMLListElt *) wbxml_malloc(sizeof(WBXMLListElt))) == NULL) return NULL; diff --git a/src/wbxml_lists.h b/src/wbxml_lists.h index 367fa62..039ffab 100644 --- a/src/wbxml_lists.h +++ b/src/wbxml_lists.h @@ -1,7 +1,7 @@ /* * libwbxml, the WBXML Library. * Copyright (C) 2002-2008 Aymerick Jehanne - * Copyright (C) 2011 Michael Bell + * Copyright (C) 2011,2014 Michael Bell * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -83,7 +83,7 @@ WBXML_DECLARE(WB_ULONG) wbxml_list_len(WBXMLList *list); /** * @brief Append an element at end of list * @param list The List - * @param elt The element to append + * @param elt The element to append which must be not null. * @return TRUE if element appended, FALSE if not enough memory */ WBXML_DECLARE(WB_BOOL) wbxml_list_append(WBXMLList *list, void *elt); @@ -91,7 +91,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_list_append(WBXMLList *list, void *elt); /** * @brief Append an element to a list * @param list The List - * @param elt The element to insert + * @param elt The element to insert which must be not null. * @param pos The index where to insert this element * @return TRUE if element appended, FALSE if not enough memory */ diff --git a/src/wbxml_parser.c b/src/wbxml_parser.c index 9f27911..eeeb82e 100644 --- a/src/wbxml_parser.c +++ b/src/wbxml_parser.c @@ -1046,8 +1046,7 @@ static WBXMLError parse_element(WBXMLParser *parser) { parser->content_hdl->start_element_clb(parser->user_data, element, - attrs, - is_empty); + attrs); } /* Free Attributes */ @@ -1093,8 +1092,7 @@ static WBXMLError parse_element(WBXMLParser *parser) (parser->content_hdl->end_element_clb != NULL)) { parser->content_hdl->end_element_clb(parser->user_data, - element, - is_empty); + element); } WBXML_DEBUG((WBXML_PARSER, "", wbxml_tag_get_xml_name(element))); @@ -1518,7 +1516,9 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space return ret; } - + if (parser->langTable == NULL) { + return WBXML_ERROR_LANG_TABLE_UNDEFINED; + } /* Language specific treatment */ switch (parser->langTable->langID) { @@ -1587,6 +1587,7 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space WBXML_STRLEN(escape) + WBXML_STRLEN(var_end) + 1); if (ext == NULL) { + wbxml_buffer_destroy(var_value); return WBXML_ERROR_NOT_ENOUGH_MEMORY; } @@ -1655,10 +1656,6 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space } /* Search Token in Extension Value Table */ - if (parser->langTable == NULL) { - return WBXML_ERROR_LANG_TABLE_UNDEFINED; - } - if (parser->langTable->extValueTable == NULL) { return WBXML_ERROR_EXT_VALUE_TABLE_UNDEFINED; } @@ -1697,6 +1694,7 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space } else { if ((*result = wbxml_buffer_create(ext, len, len)) == NULL) { + wbxml_free(ext); return WBXML_ERROR_NOT_ENOUGH_MEMORY; } @@ -2466,13 +2464,8 @@ static WBXMLError decode_opaque_content(WBXMLParser *parser, if ((parser->current_tag->wbxmlCodePage == 0x00) && (parser->current_tag->wbxmlToken == 0x0C)) { - WBXMLError ret = WBXML_OK; - /* Decode base64 value */ - if ((ret = decode_base64_value(data)) != WBXML_OK) - return ret; - - return WBXML_OK; + return decode_base64_value(data); } break; @@ -2487,13 +2480,8 @@ static WBXMLError decode_opaque_content(WBXMLParser *parser, if ((parser->current_tag->wbxmlCodePage == 0x01) && (parser->current_tag->wbxmlToken == 0x10)) { - WBXMLError ret = WBXML_OK; - /* Decode base64 value */ - if ((ret = decode_base64_value(data)) != WBXML_OK) - return ret; - - return WBXML_OK; + return decode_base64_value(data); } break; diff --git a/src/wbxml_tree.c b/src/wbxml_tree.c index e30da74..963c7ee 100644 --- a/src/wbxml_tree.c +++ b/src/wbxml_tree.c @@ -197,6 +197,12 @@ WBXML_DECLARE(WBXMLError) wbxml_tree_from_xml(WB_UTINY *xml, WB_ULONG xml_len, W WB_BOOL expat_utf16 = FALSE; WBXMLTreeClbCtx wbxml_tree_clb_ctx; + if ((xml == NULL) || (xml_len == 0) || (tree == NULL)) + return WBXML_ERROR_BAD_PARAMETER; + + /* Clean up pointer */ + *tree = NULL; + /* First Check if Expat is outputing UTF-16 strings */ feature_list = (const XML_Feature *)XML_GetFeatureList(); @@ -210,9 +216,6 @@ WBXML_DECLARE(WBXMLError) wbxml_tree_from_xml(WB_UTINY *xml, WB_ULONG xml_len, W #endif /* !HAVE_ICONV */ } - if (tree != NULL) - *tree = NULL; - /* Create Expat XML Parser */ if ((xml_parser = XML_ParserCreateNS(NULL, WBXML_NAMESPACE_SEPARATOR)) == NULL) return WBXML_ERROR_NOT_ENOUGH_MEMORY; diff --git a/src/wbxml_tree_clb_wbxml.c b/src/wbxml_tree_clb_wbxml.c index 5586335..5d97ce0 100644 --- a/src/wbxml_tree_clb_wbxml.c +++ b/src/wbxml_tree_clb_wbxml.c @@ -62,12 +62,10 @@ void wbxml_tree_clb_wbxml_end_document(void *ctx) } -void wbxml_tree_clb_wbxml_start_element(void *ctx, WBXMLTag *element, WBXMLAttribute **attrs, WB_BOOL empty) +void wbxml_tree_clb_wbxml_start_element(void *ctx, WBXMLTag *element, WBXMLAttribute **attrs) { WBXMLTreeClbCtx *tree_ctx = (WBXMLTreeClbCtx *) ctx; - (void) empty; /* avoid warning about unused parameter */ - if (tree_ctx->error != WBXML_OK) return; @@ -82,12 +80,10 @@ void wbxml_tree_clb_wbxml_start_element(void *ctx, WBXMLTag *element, WBXMLAttri } -void wbxml_tree_clb_wbxml_end_element(void *ctx, WBXMLTag *element, WB_BOOL empty) +void wbxml_tree_clb_wbxml_end_element(void *ctx, WBXMLTag *element) { WBXMLTreeClbCtx *tree_ctx = (WBXMLTreeClbCtx *) ctx; - (void) empty; /* avoid warning about unused parameter */ - if (tree_ctx->error != WBXML_OK) return; diff --git a/src/wbxml_tree_clb_wbxml.h b/src/wbxml_tree_clb_wbxml.h index b2738f9..9614c8a 100644 --- a/src/wbxml_tree_clb_wbxml.h +++ b/src/wbxml_tree_clb_wbxml.h @@ -66,17 +66,15 @@ void wbxml_tree_clb_wbxml_end_document(void *ctx); * @param ctx User data * @param element The Tag Element * @param atts The attributes attached to the element - * @param empty Set to TRUE if this is an empty element */ -void wbxml_tree_clb_wbxml_start_element(void *ctx, WBXMLTag *element, WBXMLAttribute **atts, WB_BOOL empty); +void wbxml_tree_clb_wbxml_start_element(void *ctx, WBXMLTag *element, WBXMLAttribute **atts); /** * @brief End Element Callback * @param ctx User data * @param element The Tag Element - * @param empty Set to TRUE if this is an empty element */ -void wbxml_tree_clb_wbxml_end_element(void *ctx, WBXMLTag *element, WB_BOOL empty); +void wbxml_tree_clb_wbxml_end_element(void *ctx, WBXMLTag *element); /** * @brief Characters Callback diff --git a/src/wbxml_tree_clb_xml.c b/src/wbxml_tree_clb_xml.c index 77ed42d..bc6bde9 100644 --- a/src/wbxml_tree_clb_xml.c +++ b/src/wbxml_tree_clb_xml.c @@ -42,6 +42,7 @@ #include "wbxml_log.h" #include "wbxml_charset.h" #include "wbxml_base64.h" +#include /************************************ * Public Functions @@ -190,19 +191,16 @@ void wbxml_tree_clb_xml_end_element(void *ctx, const XML_Char *localName) { WBXMLTreeClbCtx *tree_ctx = (WBXMLTreeClbCtx *) ctx; -#if defined( WBXML_SUPPORT_SYNCML ) - WBXMLBuffer *embed_doc = NULL; WBXMLBuffer *content = NULL; - WBXMLTree *tree = NULL; WBXMLTreeNode *node = NULL; WBXMLError ret = WBXML_OK; -#endif /* WBXML_SUPPORT_SYNCML */ WBXML_DEBUG((WBXML_PARSER, "Expat element end callback ('%s')", localName)); /* If the node is flagged as binary node * then the data is base64 encoded in the XML document * and the data must be decoded in one step. + * Examples: Microsoft ActiveSync tags ConversationId or MIME */ node = tree_ctx->current; @@ -260,6 +258,8 @@ void wbxml_tree_clb_xml_end_element(void *ctx, if (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0 || WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) { /* definitions first ... or some compilers don't like it */ + WBXMLBuffer *embed_doc = NULL; + WBXMLTree *tree = NULL; const WBXMLLangEntry *lang; /* Get embedded DevInf or DM DDF Document */ @@ -313,9 +313,17 @@ void wbxml_tree_clb_xml_end_element(void *ctx, break; default: tree_ctx->error = WBXML_ERROR_UNKNOWN_XML_LANGUAGE; + wbxml_buffer_destroy(embed_doc); return; } + assert (lang!= NULL); + if (lang == NULL) { + tree_ctx->error = WBXML_ERROR_UNKNOWN_XML_LANGUAGE; + wbxml_buffer_destroy(embed_doc); + return; + } + /* DOCTYPE in reverse order */ if (!wbxml_buffer_insert_cstr(embed_doc,(WB_UTINY *) "\">\n", 0) || /* > */ !wbxml_buffer_insert_cstr(embed_doc, (WB_UTINY *) lang->publicID->xmlDTD, 0) || /* DTD */ diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt new file mode 100644 index 0000000..2bd9d11 --- /dev/null +++ b/test/api/CMakeLists.txt @@ -0,0 +1,22 @@ + +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + +ENABLE_TESTING() +FIND_PACKAGE(Check REQUIRED) + +INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CHECK_INCLUDE_DIRS} ) + +## Test private API + +FOREACH( SRC_FILE lists buffers base64 charset conv encoder_internals errors parser_internals ) + + ADD_EXECUTABLE(test_wbxml_${SRC_FILE} test_wbxml_${SRC_FILE}.c api_test.c) + + TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} wbxml2) + TARGET_LINK_LIBRARIES(test_wbxml_${SRC_FILE} ${CHECK_LIBRARIES}) + + ADD_TEST(api_private_wbxml_${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/test_wbxml_${SRC_FILE}) + +ENDFOREACH( SRC_FILE lists ) diff --git a/test/api/api_test.c b/test/api/api_test.c new file mode 100644 index 0000000..7b3d15d --- /dev/null +++ b/test/api/api_test.c @@ -0,0 +1,14 @@ +#include +#include + +Suite* wbxml_suite (void); + +int main (int argc, char *argv[]) { + int number_failed; + Suite *suite = wbxml_suite(); + SRunner *runner = srunner_create(suite); + srunner_run_all(runner, CK_NORMAL); + number_failed = srunner_ntests_failed(runner); + srunner_free(runner); + return number_failed; +} diff --git a/test/api/api_test.h b/test/api/api_test.h new file mode 100644 index 0000000..09d98b8 --- /dev/null +++ b/test/api/api_test.h @@ -0,0 +1,16 @@ +#include + +#define BEGIN_TESTS(name) \ + Suite* wbxml_suite (void) {\ + Suite *suite = suite_create("name");\ + TCase *tcase; + +#define ADD_TEST(name) \ + tcase = tcase_create("name"); \ + tcase_add_test(tcase, name); \ + suite_add_tcase(suite, tcase); + +#define END_TESTS \ + return suite; \ + } + diff --git a/test/api/test_wbxml_base64.c b/test/api/test_wbxml_base64.c new file mode 100644 index 0000000..64082116 --- /dev/null +++ b/test/api/test_wbxml_base64.c @@ -0,0 +1,68 @@ +#include "api_test.h" + +#include "../../src/wbxml_base64.h" + +START_TEST (test_encode) +{ + WB_UTINY *result; + + /* verify empty strings */ + + 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); + + /* encode a string */ + + result = wbxml_base64_encode("test", 4); + ck_assert(result != NULL); + ck_assert(strlen(result) == 8); + ck_assert(strncmp(result, "dGVzdA==", 8) == 0); + wbxml_free(result); +} +END_TEST + +START_TEST (test_decode) +{ + WB_UTINY *result; + + /* verify empty strings */ + + 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); + + /* decode a string */ + + ck_assert(wbxml_base64_decode("dGVzdA==", 8, &result) == 4); + ck_assert(strncmp(result, "test", 4) == 0); + wbxml_free(result); +} +END_TEST + +START_TEST (test_encode_and_decode) +{ + WB_UTINY *enc; + WB_UTINY *dec; + + /* encode */ + + enc = wbxml_base64_encode("test", 4); + ck_assert(wbxml_base64_decode(enc, strlen(enc), &dec) == 4); + ck_assert(strncmp(dec, "test", 4) == 0); + wbxml_free(enc); + wbxml_free(dec); +} +END_TEST + +BEGIN_TESTS(wbxml_base64) + + ADD_TEST(test_encode); + ADD_TEST(test_decode); + ADD_TEST(test_encode_and_decode); + +END_TESTS + diff --git a/test/api/test_wbxml_buffers.c b/test/api/test_wbxml_buffers.c new file mode 100644 index 0000000..17ee6c3 --- /dev/null +++ b/test/api/test_wbxml_buffers.c @@ -0,0 +1,650 @@ +#include "api_test.h" + +#include "../../src/wbxml_buffers.h" + +START_TEST (test_init_and_destroy) +{ + WBXMLBuffer *buf; + const char *t1 = "test 1"; + + buf = wbxml_buffer_create(t1, strlen(t1)-2, 4); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 4); + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_init_and_destroy_string) +{ + WBXMLBuffer *buf; + const char *t1 = "test 1"; + + buf = wbxml_buffer_create_from_cstr(t1); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 6); + wbxml_buffer_destroy(buf); +} +END_TEST + +/* + This test is only necessary because on Win32 systems + WBXML_DECLARE and WBXML_DECLARE_NONSTD are different. +*/ +START_TEST (test_init_and_destroy_win32) +{ + WBXMLBuffer *buf; + const char *t1 = "test 1"; + + buf = wbxml_buffer_create(t1, strlen(t1)-2, 4); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 4); + wbxml_buffer_destroy_item(buf); +} +END_TEST + +START_TEST (test_init_and_destroy_static) +{ + WBXMLBuffer *buf, *buf2; + const char *t1 = " abcdef test 12 "; + const char *t2 = "no"; + + buf = wbxml_buffer_sta_create(t1, 4); + buf2 = wbxml_buffer_create_from_cstr(t2); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 4); + + /* check that all write functions are blocked */ + + 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_append(buf, buf2)); + ck_assert( ! wbxml_buffer_append_data(buf, t2, 2)); + ck_assert( ! wbxml_buffer_append_cstr(buf, t2)); + ck_assert( ! wbxml_buffer_append_char(buf, 'c')); + ck_assert( ! wbxml_buffer_append_mb_uint_32(buf, 12345)); + + ck_assert( ! wbxml_buffer_delete(buf, 2, 1)); + ck_assert( ! wbxml_buffer_shrink_blanks(buf)); + ck_assert( ! wbxml_buffer_strip_blanks(buf)); + + ck_assert( ! wbxml_buffer_hex_to_binary(buf)); + ck_assert( ! wbxml_buffer_binary_to_hex(buf, FALSE)); + + ck_assert( wbxml_buffer_decode_base64(buf) == WBXML_ERROR_INTERNAL ); + ck_assert( wbxml_buffer_encode_base64(buf) == WBXML_ERROR_INTERNAL ); + + ck_assert( ! wbxml_buffer_remove_trailing_zeros(buf)); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_set_char) +{ + WBXMLBuffer *buf; + const char *t1 = "test 1"; + char c; + + buf = wbxml_buffer_create_from_cstr(t1); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 6); + + /* set first char */ + + ck_assert(wbxml_buffer_set_char(buf, 0, 'T')); + ck_assert(wbxml_buffer_get_char(buf, 0, &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(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(c == '2'); + + /* set last+1 char */ + + ck_assert(! wbxml_buffer_set_char(buf, 6, 'X')); + + /* set last+2 char */ + + ck_assert(! wbxml_buffer_set_char(buf, 7, 'T')); + + /* check for correct result */ + + ck_assert(wbxml_buffer_compare_cstr(buf, "TeSt 2") == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_append) +{ + WBXMLBuffer *buf, *buf2; + WB_UTINY c; + + /* create empty buffer */ + + buf = wbxml_buffer_create_from_cstr(""); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 0); + + /* append to empty buffer */ + + ck_assert(wbxml_buffer_append_cstr(buf, "test")); + ck_assert(wbxml_buffer_len(buf) == 4); + + /* append buffer */ + + buf2 = wbxml_buffer_create_from_cstr("1"); + ck_assert(wbxml_buffer_append(buf, buf2)); + wbxml_buffer_destroy(buf2); + ck_assert(wbxml_buffer_compare_cstr(buf, "test1") == 0); + + /* append cstr */ + + ck_assert(wbxml_buffer_append_cstr(buf, "12")); + ck_assert(wbxml_buffer_compare_cstr(buf, "test112") == 0); + + /* append data */ + + ck_assert(wbxml_buffer_append_data(buf, "1234", 3)); + ck_assert(wbxml_buffer_compare_cstr(buf, "test112123") == 0); + + /* append char */ + + ck_assert(wbxml_buffer_append_char(buf, '5')); + ck_assert(wbxml_buffer_compare_cstr(buf, "test1121235") == 0); + + /* append mb uint 32 */ + /* |00000000|00000000|00000000|00000000| => 0 => |00000000| => '0' */ + /* |00000000|00000001|00000000|00000001| => 0 => |10000100|10000000|00000001| => */ + + ck_assert(wbxml_buffer_append_mb_uint_32(buf, (WB_ULONG) 0)); + ck_assert(wbxml_buffer_len(buf) == 12); + ck_assert(wbxml_buffer_get_char(buf, 11, &c)); + ck_assert(c == 0); + ck_assert((WB_ULONG) 0x010001 == (WB_ULONG) 65537); + ck_assert(wbxml_buffer_append_mb_uint_32(buf, (WB_ULONG) 65537)); + ck_assert(wbxml_buffer_len(buf) == 15); + ck_assert(wbxml_buffer_get_char(buf, 12, &c)); + ck_assert(c == (WB_UTINY) 0x84); + ck_assert(wbxml_buffer_get_char(buf, 13, &c)); + ck_assert(c == (WB_UTINY) 0x80); + ck_assert(wbxml_buffer_get_char(buf, 14, &c)); + ck_assert(c == (WB_UTINY) 0x01); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_insert) +{ + WBXMLBuffer *buf, *buf2; + + /* create empty buffer */ + + buf = wbxml_buffer_create_from_cstr(""); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 0); + + /* insert to an empty buffer */ + + ck_assert(wbxml_buffer_insert_cstr(buf, "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_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_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_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_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_len(buf) == 9); + ck_assert(wbxml_buffer_compare_cstr(buf, "123tes7t9") == 0); + + /* insert buffer */ + + buf2 = wbxml_buffer_create_from_cstr("XYZ"); + ck_assert(wbxml_buffer_insert(buf, buf2, 3)); + ck_assert(wbxml_buffer_len(buf) == 12); + ck_assert(wbxml_buffer_compare_cstr(buf, "123XYZtes7t9") == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_delete) +{ + WBXMLBuffer *buf; + + /* create empty buffer */ + + buf = wbxml_buffer_create_from_cstr(""); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 0); + + /* delete in an empty buffer */ + + ck_assert( ! wbxml_buffer_delete(buf, 0, 0)); + ck_assert(wbxml_buffer_len(buf) == 0); + ck_assert( ! wbxml_buffer_delete(buf, 0, 1)); + ck_assert(wbxml_buffer_len(buf) == 0); + + /* insert */ + + ck_assert(wbxml_buffer_insert_cstr(buf, "test", 0)); + ck_assert(wbxml_buffer_len(buf) == 4); + + /* delete head */ + + ck_assert(wbxml_buffer_delete(buf, 0, 1)); + ck_assert(wbxml_buffer_len(buf) == 3); + ck_assert(wbxml_buffer_compare_cstr(buf, "est") == 0); + + /* delete last */ + + ck_assert(wbxml_buffer_delete(buf, 2, 1)); + ck_assert(wbxml_buffer_len(buf) == 2); + ck_assert(wbxml_buffer_compare_cstr(buf, "es") == 0); + + /* delete last+1 */ + + ck_assert( ! wbxml_buffer_delete(buf, 2, 1)); + ck_assert(wbxml_buffer_len(buf) == 2); + ck_assert(wbxml_buffer_compare_cstr(buf, "es") == 0); + + /* delete all */ + + ck_assert(wbxml_buffer_delete(buf, 0, 2)); + ck_assert(wbxml_buffer_len(buf) == 0); + ck_assert(wbxml_buffer_compare_cstr(buf, "") == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_compare) +{ + WBXMLBuffer *buf, *buf2; + + /* compare empty buffer */ + + buf = wbxml_buffer_create_from_cstr(""); + buf2 = wbxml_buffer_create_from_cstr(""); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 0); + ck_assert(buf2 != NULL); + ck_assert(wbxml_buffer_len(buf2) == 0); + ck_assert(wbxml_buffer_compare(buf, buf2) == 0); + ck_assert(wbxml_buffer_compare_cstr(buf, "") == 0); + + /* compare empty and filled buffer */ + + wbxml_buffer_destroy(buf2); + buf2 = wbxml_buffer_create_from_cstr("test"); + ck_assert(buf2 != NULL); + ck_assert(wbxml_buffer_len(buf2) == 4); + ck_assert(wbxml_buffer_compare(buf, buf2) != 0); + ck_assert(wbxml_buffer_compare_cstr(buf, "test") != 0); + + /* compare empty and filled buffer */ + + wbxml_buffer_destroy(buf); + buf = wbxml_buffer_create_from_cstr("test"); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 4); + ck_assert(wbxml_buffer_compare(buf, buf2) == 0); + ck_assert(wbxml_buffer_compare_cstr(buf, "test") == 0); + + wbxml_buffer_destroy(buf); + buf = wbxml_buffer_create_from_cstr("TEST"); + ck_assert(buf != NULL); + ck_assert(wbxml_buffer_len(buf) == 4); + ck_assert(wbxml_buffer_compare(buf, buf2) != 0); + ck_assert(wbxml_buffer_compare_cstr(buf, "test") != 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_search) +{ + WBXMLBuffer *buf, *buf2; + WB_ULONG l; + + buf2 = wbxml_buffer_create_from_cstr("123"); + + /* test with null/empty buffer */ + + buf = wbxml_buffer_create_from_cstr(""); + + ck_assert(! wbxml_buffer_search_char(NULL, '3', 0, &l)); + + ck_assert(! wbxml_buffer_search(NULL, buf2, 0, &l)); + ck_assert(! wbxml_buffer_search(buf, NULL, 0, &l)); + 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, NULL, 0, &l)); + ck_assert(! wbxml_buffer_search_cstr(buf, "123", 0, &l)); + l = 1; + ck_assert(wbxml_buffer_search_cstr(buf, "", 0, &l)); + ck_assert(l == 0); + ck_assert(! wbxml_buffer_search_cstr(buf, NULL, 0, &l)); + + wbxml_buffer_destroy(buf); + + /* test with filled buffer */ + + buf = wbxml_buffer_create_from_cstr("test123ABCD"); + + ck_assert(wbxml_buffer_search_char(buf, '3', 0, &l)); + ck_assert(l == 6); + ck_assert(wbxml_buffer_search_char(buf, '3', 0, NULL)); + ck_assert(! wbxml_buffer_search_char(buf, '3', 7, &l)); + ck_assert(! wbxml_buffer_search_char(buf, '3', 7, NULL)); + + ck_assert(wbxml_buffer_search(buf, buf2, 4, &l)); + ck_assert(l == 4); + ck_assert(wbxml_buffer_search(buf, buf2, 4, NULL)); + ck_assert(! wbxml_buffer_search(buf, buf2, 5, &l)); + ck_assert(! wbxml_buffer_search(buf, buf2, 5, NULL)); + + l = 1; + ck_assert(wbxml_buffer_search_cstr(buf, "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(l == 0); + ck_assert(! wbxml_buffer_search_cstr(buf, NULL, 0, &l)); + + /* search after end */ + + 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)); + + wbxml_buffer_destroy(buf); + wbxml_buffer_destroy(buf2); +} +END_TEST + +START_TEST (test_split_words) +{ + WBXMLBuffer *buf, *item; + WBXMLList *list; + int i; + + /* test with null/empty buffer */ + + ck_assert(wbxml_buffer_split_words(NULL) == NULL); + + buf = wbxml_buffer_create_from_cstr(""); + list = wbxml_buffer_split_words(buf); + ck_assert(list != NULL); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); + wbxml_buffer_destroy(buf); + + buf = wbxml_buffer_create_from_cstr(" \n\r\v\f\t"); + list = wbxml_buffer_split_words(buf); + ck_assert(list != NULL); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); + wbxml_buffer_destroy(buf); + + /* split several words an verify it */ + + buf = wbxml_buffer_create_from_cstr(" 1\n2\r3\v4\f5\t"); + list = wbxml_buffer_split_words(buf); + ck_assert(list != NULL); + ck_assert(wbxml_list_len(list) == 5); + for (i=0; i<5; i++) { + item = wbxml_list_extract_first(list); + ck_assert(item != NULL); + switch(i) { + case 0: ck_assert(wbxml_buffer_compare_cstr(item, "1") == 0); break; + case 1: ck_assert(wbxml_buffer_compare_cstr(item, "2") == 0); break; + case 2: ck_assert(wbxml_buffer_compare_cstr(item, "3") == 0); break; + case 3: ck_assert(wbxml_buffer_compare_cstr(item, "4") == 0); break; + case 4: ck_assert(wbxml_buffer_compare_cstr(item, "5") == 0); break; + default: ck_abort(); + } + wbxml_buffer_destroy(item); + } + wbxml_list_destroy(list, NULL); + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_duplicate) +{ + WBXMLBuffer *buf, *dup; + + /* test with null/empty/filled buffer */ + + ck_assert(wbxml_buffer_duplicate(NULL) == NULL); + + buf = wbxml_buffer_create_from_cstr(""); + dup = wbxml_buffer_duplicate(buf); + ck_assert(dup != NULL); + ck_assert(wbxml_buffer_compare(buf, dup) == 0); + ck_assert(wbxml_buffer_compare_cstr(dup, "") == 0); + wbxml_buffer_destroy(dup); + wbxml_buffer_destroy(buf); + + buf = wbxml_buffer_create_from_cstr("test"); + dup = wbxml_buffer_duplicate(buf); + ck_assert(dup != NULL); + ck_assert(wbxml_buffer_compare(buf, dup) == 0); + ck_assert(wbxml_buffer_compare_cstr(dup, "test") == 0); + wbxml_buffer_destroy(dup); + wbxml_buffer_destroy(buf); + + /* test with static */ + + buf = wbxml_buffer_sta_create_from_cstr("test"); + dup = wbxml_buffer_duplicate(buf); + ck_assert(dup != NULL); + ck_assert(wbxml_buffer_compare(buf, dup) == 0); + ck_assert(wbxml_buffer_compare_cstr(dup, "test") == 0); + wbxml_buffer_destroy(dup); + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_conversion_hex) +{ + WBXMLBuffer *buf; + const char *bin = "test image"; + const char *hex = "7465737420696D616765"; + + /* test convert to base64 */ + + buf = wbxml_buffer_create_from_cstr(bin); + ck_assert(wbxml_buffer_binary_to_hex(buf, TRUE)); + ck_assert(wbxml_buffer_compare_cstr(buf, hex) == 0); + wbxml_buffer_destroy(buf); + + /* test convert to binary */ + + buf = wbxml_buffer_create_from_cstr(hex); + ck_assert(wbxml_buffer_hex_to_binary(buf)); + ck_assert(wbxml_buffer_compare_cstr(buf, bin) == 0); + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_conversion_base64) +{ + WBXMLBuffer *buf; + const char *bin = "test image\n"; + const char *b64 = "dGVzdCBpbWFnZQo="; + + /* test convert to base64 */ + + buf = wbxml_buffer_create_from_cstr(bin); + ck_assert(wbxml_buffer_encode_base64(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, b64) == 0); + wbxml_buffer_destroy(buf); + + /* test convert to binary */ + + buf = wbxml_buffer_create_from_cstr(b64); + ck_assert(wbxml_buffer_decode_base64(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, bin) == 0); + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_shrink_blanks) +{ + WBXMLBuffer *buf; + const char *raw = " \n\t\rtest\n\f\t image\t\v \n"; + const char *fix = " test image "; + + /* init buffers */ + + buf = wbxml_buffer_create_from_cstr(raw); + ck_assert(buf != NULL); + + /* shrink and test */ + + ck_assert(wbxml_buffer_shrink_blanks(buf)); + ck_assert(wbxml_buffer_compare_cstr(buf, fix) == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_strip_blanks) +{ + WBXMLBuffer *buf; + const char *raw = " \n\t\f\rtest image\t\v \n"; + const char *fix = "test image"; + + /* init buffers */ + + buf = wbxml_buffer_create_from_cstr(raw); + ck_assert(buf != NULL); + + /* shrink and test */ + + ck_assert(wbxml_buffer_strip_blanks(buf)); + ck_assert(wbxml_buffer_compare_cstr(buf, fix) == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_remove_trailing_zeros) +{ + WBXMLBuffer *buf; + const char *raw = "test image\0\0\0"; + const char *fix = "test image"; + + /* init buffers */ + + buf = wbxml_buffer_create(raw, 13, 13); + ck_assert(buf != NULL); + + /* shrink and test */ + + ck_assert(wbxml_buffer_remove_trailing_zeros(buf)); + ck_assert(wbxml_buffer_compare_cstr(buf, fix) == 0); + + wbxml_buffer_destroy(buf); +} +END_TEST + +START_TEST (test_buffer_get_char_wrong_params) +{ + WBXMLBuffer *buf; + WB_UTINY result; + + /* init buffer */ + + buf = wbxml_buffer_create("test", 4, 4); + ck_assert(buf != NULL); + + /* test */ + + ck_assert(wbxml_buffer_get_char(NULL, 0, &result) == FALSE); + ck_assert(wbxml_buffer_get_char(buf, 0, &result) == TRUE); + ck_assert(wbxml_buffer_get_char(buf, 3, &result) == TRUE); + ck_assert(wbxml_buffer_get_char(buf, 4, &result) == FALSE); + ck_assert(wbxml_buffer_get_char(buf, 0, NULL) == FALSE); + + /* cleanup buffer */ + + wbxml_buffer_destroy(buf); +} +END_TEST + +BEGIN_TESTS(wbxml_buffers) + + /* initialization */ + ADD_TEST(test_init_and_destroy); + ADD_TEST(test_init_and_destroy_string); + ADD_TEST(test_init_and_destroy_win32); + ADD_TEST(test_init_and_destroy_static); + + /* write operations */ + ADD_TEST(test_set_char); + ADD_TEST(test_append); + ADD_TEST(test_insert); + ADD_TEST(test_delete); + + /* read operations */ + ADD_TEST(test_compare); + ADD_TEST(test_search); + + /* buffer level write functions */ + ADD_TEST(test_split_words); + ADD_TEST(test_duplicate); + + /* conversion */ + ADD_TEST(test_conversion_hex); + ADD_TEST(test_conversion_base64); + + /* handle whitespaces */ + ADD_TEST(test_shrink_blanks); + ADD_TEST(test_strip_blanks); + ADD_TEST(test_remove_trailing_zeros); + + /* found bugs - test driven development */ + ADD_TEST(test_buffer_get_char_wrong_params); + +END_TESTS + diff --git a/test/api/test_wbxml_charset.c b/test/api/test_wbxml_charset.c new file mode 100644 index 0000000..bdfab1f --- /dev/null +++ b/test/api/test_wbxml_charset.c @@ -0,0 +1,26 @@ +#include "api_test.h" + +#include "../../src/wbxml_charset.h" + +START_TEST (test_charset_existence) +{ + const WB_TINY *name [4] = { "UTF-8", "UTF-16", "ISO-8859-1", "US-ASCII"}; + WBXMLCharsetMIBEnum mib = 0; + const WB_TINY *charset = NULL; + int i; + + for (i=0; i < 4; i++) + { + ck_assert(wbxml_charset_get_mib(name[i], &mib) == TRUE); + ck_assert(wbxml_charset_get_name(mib, &charset) == TRUE); + ck_assert(strcmp(name[i], charset) == 0); + } +} +END_TEST + +BEGIN_TESTS(wbxml_charset) + + ADD_TEST(test_charset_existence); + +END_TESTS + diff --git a/test/api/test_wbxml_conv.c b/test/api/test_wbxml_conv.c new file mode 100644 index 0000000..c226dc3 --- /dev/null +++ b/test/api/test_wbxml_conv.c @@ -0,0 +1,18 @@ +#include "api_test.h" + +#include "../../src/wbxml_conv.h" + +START_TEST (security_test_conv_init_null_reference) +{ + /* use undefined converter address reference */ + ck_assert(wbxml_conv_wbxml2xml_create(NULL) == WBXML_ERROR_BAD_PARAMETER); + ck_assert(wbxml_conv_xml2wbxml_create(NULL) == WBXML_ERROR_BAD_PARAMETER); +} +END_TEST + +BEGIN_TESTS(wbxml_conv) + + ADD_TEST(security_test_conv_init_null_reference); + +END_TESTS + diff --git a/test/api/test_wbxml_encoder_internals.c b/test/api/test_wbxml_encoder_internals.c new file mode 100644 index 0000000..9ebe385 --- /dev/null +++ b/test/api/test_wbxml_encoder_internals.c @@ -0,0 +1,29 @@ +#include "api_test.h" + +#include "../../src/wbxml_encoder.c" + +START_TEST (security_test_xml_build_result_null_params) +{ + WBXMLEncoder *enc = NULL; + WB_UTINY *xml = NULL; + WB_ULONG len = 0; + + enc = wbxml_encoder_create(); + + /* Check: xml_len == NULL */ + /* There is no default XML doctype. */ + ck_assert(xml_build_result(enc, &xml, (WB_ULONG *) NULL) == WBXML_ERROR_LANG_TABLE_UNDEFINED); + + /* Check: xml == NULL */ + ck_assert(xml_build_result(enc, NULL, NULL) == WBXML_ERROR_BAD_PARAMETER); + + wbxml_encoder_destroy(enc); +} +END_TEST + +BEGIN_TESTS(wbxml_encoder_internals) + + ADD_TEST(security_test_xml_build_result_null_params); + +END_TESTS + diff --git a/test/api/test_wbxml_errors.c b/test/api/test_wbxml_errors.c new file mode 100644 index 0000000..be8159e --- /dev/null +++ b/test/api/test_wbxml_errors.c @@ -0,0 +1,43 @@ +#include "api_test.h" + +#include "../../src/wbxml_errors.h" + +START_TEST (security_test_errors_datetime_without_percent) +{ + ck_assert(strchr(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); +} +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_errors_string(WBXML_ERROR_CHARSET_NOT_FOUND) != NULL); + ck_assert(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); +} +END_TEST + +BEGIN_TESTS(wbxml_errors) + + ADD_TEST(security_test_errors_datetime_without_percent); + ADD_TEST(test_errors_ok); + ADD_TEST(test_errors_last_item); + ADD_TEST(test_errors_unknown_error_code); + +END_TESTS + diff --git a/test/api/test_wbxml_lists.c b/test/api/test_wbxml_lists.c new file mode 100644 index 0000000..eb813fc --- /dev/null +++ b/test/api/test_wbxml_lists.c @@ -0,0 +1,156 @@ +#include "api_test.h" + +#include "../../src/wbxml_lists.h" + +START_TEST (test_init_and_destroy) +{ + WBXMLList *list; + + list = wbxml_list_create(); + ck_assert(list != NULL); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_append_not_null) +{ + WBXMLList *list; + + list = wbxml_list_create(); + ck_assert(wbxml_list_append(list, NULL) == FALSE); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_insert_not_null) +{ + WBXMLList *list; + + list = wbxml_list_create(); + ck_assert(wbxml_list_insert(list, NULL, 0) == FALSE); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_insert_wrong_pos) +{ + WBXMLList *list; + + list = wbxml_list_create(); + ck_assert(wbxml_list_insert(list, NULL, 4) == FALSE); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_append) +{ + WBXMLList *list; + const char *t1 = "test 1"; + const char *t2 = "test 2"; + const char *t3 = "test 3"; + + list = wbxml_list_create(); + ck_assert(wbxml_list_get(list, 0) == NULL); + ck_assert(wbxml_list_append(list, (void *) t1) == TRUE); + ck_assert(wbxml_list_len(list) == 1); + ck_assert(wbxml_list_append(list, (void *) t2) == TRUE); + ck_assert(wbxml_list_len(list) == 2); + ck_assert(wbxml_list_append(list, (void *) t3) == TRUE); + ck_assert(wbxml_list_len(list) == 3); + ck_assert(strcmp(wbxml_list_get(list, 0), t1) == 0); + ck_assert(strcmp(wbxml_list_get(list, 1), t2) == 0); + ck_assert(strcmp(wbxml_list_get(list, 2), t3) == 0); + ck_assert(wbxml_list_len(list) == 3); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_insert) +{ + WBXMLList *list; + const char *t1 = "test 1"; + const char *t2 = "test 2"; + const char *t3 = "test 3"; + const char *t4 = "test 4"; + const char *t5 = "test 5"; + + list = wbxml_list_create(); + ck_assert(wbxml_list_get(list, 0) == NULL); + ck_assert(wbxml_list_insert(list, (void *) t1, 0) == TRUE); + ck_assert(wbxml_list_len(list) == 1); + ck_assert(wbxml_list_insert(list, (void *) t2, 1) == TRUE); + ck_assert(wbxml_list_len(list) == 2); + ck_assert(wbxml_list_insert(list, (void *) t3, 1) == TRUE); + ck_assert(wbxml_list_len(list) == 3); + ck_assert(wbxml_list_insert(list, (void *) t4, 0) == TRUE); + ck_assert(wbxml_list_len(list) == 4); + ck_assert(wbxml_list_insert(list, (void *) t5, 4) == TRUE); + ck_assert(wbxml_list_len(list) == 5); + ck_assert(strcmp(wbxml_list_get(list, 0), t4) == 0); + ck_assert(strcmp(wbxml_list_get(list, 1), t1) == 0); + ck_assert(strcmp(wbxml_list_get(list, 2), t3) == 0); + ck_assert(strcmp(wbxml_list_get(list, 3), t2) == 0); + ck_assert(strcmp(wbxml_list_get(list, 4), t5) == 0); + ck_assert(wbxml_list_len(list) == 5); + wbxml_list_destroy(list, NULL); +} +END_TEST + +START_TEST (test_extract_first) +{ + WBXMLList *list; + const char *t1 = "test 1"; + const char *t2 = "test 2"; + + list = wbxml_list_create(); + ck_assert(wbxml_list_get(list, 0) == NULL); + ck_assert(wbxml_list_insert(list, (void *) t1, 0) == TRUE); + ck_assert(wbxml_list_len(list) == 1); + ck_assert(wbxml_list_insert(list, (void *) t2, 1) == TRUE); + ck_assert(wbxml_list_len(list) == 2); + ck_assert(strcmp(wbxml_list_extract_first(list), t1) == 0); + ck_assert(wbxml_list_len(list) == 1); + ck_assert(strcmp(wbxml_list_extract_first(list), t2) == 0); + ck_assert(wbxml_list_len(list) == 0); + ck_assert(wbxml_list_extract_first(list) == NULL); + ck_assert(wbxml_list_len(list) == 0); + wbxml_list_destroy(list, NULL); +} +END_TEST + +void list_element_destructor(int *element) +{ + *element = 0; +} + +START_TEST (test_destructor) +{ + WBXMLList *list; + int i = 1; + + list = wbxml_list_create(); + ck_assert(wbxml_list_append(list, &i) == TRUE); + ck_assert(wbxml_list_len(list) == 1); + ck_assert(i == 1); + wbxml_list_destroy(list, (void *)(void *) &list_element_destructor); + ck_assert(i == 0); +} +END_TEST + +BEGIN_TESTS(wbxml_lists) + + ADD_TEST(test_init_and_destroy); + ADD_TEST(test_append_not_null); + ADD_TEST(test_insert_not_null); + ADD_TEST(test_insert_wrong_pos); + ADD_TEST(test_append); + ADD_TEST(test_insert); + ADD_TEST(test_extract_first); + ADD_TEST(test_destructor); + +END_TESTS + diff --git a/test/api/test_wbxml_parser_internals.c b/test/api/test_wbxml_parser_internals.c new file mode 100644 index 0000000..641aea5 --- /dev/null +++ b/test/api/test_wbxml_parser_internals.c @@ -0,0 +1,75 @@ +#include "api_test.h" + +#include "../../src/wbxml_parser.c" + +#if ( defined( WBXML_SUPPORT_SI ) || defined( WBXML_SUPPORT_EMN ) ) + +/* This test case verifies the standard compliance. + The used timestamp is exactly the example from the OMA specification. + 2002-04-16T06:40:00Z + 0010 0000 0000 0010 => 2 0 0 2 + 0000 0100 => 0 4 + 0001 0110 => 1 6 + 0000 0110 => 0 6 + 0100 0000 => 4 0 + 0000 0000 => 0 0 (not encoded - ommitted) + */ +START_TEST (test_parser_decode_datetime) +{ + const char opaque[7] = { 0x20, 0x02, 0x04, 0x16, 0x06, 0x40, 0x12 }; + WBXMLBuffer *buf = NULL; + + /* test timestamp including minutes */ + buf = wbxml_buffer_create(opaque, 7, 7); + ck_assert(buf != NULL); + ck_assert(decode_datetime(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, "2002-04-16T06:40:12Z") == 0); + wbxml_buffer_destroy(buf); + buf = NULL; + + /* test timestamp including minutes - OMA example*/ + buf = wbxml_buffer_create(opaque, 6, 6); + ck_assert(buf != NULL); + ck_assert(decode_datetime(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, "2002-04-16T06:40:00Z") == 0); + wbxml_buffer_destroy(buf); + buf = NULL; + + /* test timestamp including hours */ + buf = wbxml_buffer_create(opaque, 5, 5); + ck_assert(buf != NULL); + ck_assert(decode_datetime(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, "2002-04-16T06:00:00Z") == 0); + wbxml_buffer_destroy(buf); + buf = NULL; + + /* test timestamp including date */ + buf = wbxml_buffer_create(opaque, 4, 4); + ck_assert(buf != NULL); + ck_assert(decode_datetime(buf) == WBXML_OK); + ck_assert(wbxml_buffer_compare_cstr(buf, "2002-04-16T00:00:00Z") == 0); + wbxml_buffer_destroy(buf); + buf = NULL; + + /* test incomplete timestamp => ERROR */ + buf = wbxml_buffer_create(opaque, 3, 3); + ck_assert(buf != NULL); + ck_assert(decode_datetime(buf) == WBXML_ERROR_BAD_DATETIME); + wbxml_buffer_destroy(buf); + buf = NULL; + + /* test NULL timestamp => ERROR */ + ck_assert(decode_datetime(NULL) == WBXML_ERROR_INTERNAL); +} +END_TEST + +#endif /* WBXML_SUPPORT_SI || WBXML_SUPPORT_EMN */ + +BEGIN_TESTS(wbxml_parser_internals) + +#if ( defined( WBXML_SUPPORT_SI ) || defined( WBXML_SUPPORT_EMN ) ) + ADD_TEST(test_parser_decode_datetime); +#endif /* WBXML_SUPPORT_SI || WBXML_SUPPORT_EMN */ + +END_TESTS + diff --git a/test/tools/CMakeLists.txt b/test/tools/CMakeLists.txt new file mode 100644 index 0000000..2dd492d --- /dev/null +++ b/test/tools/CMakeLists.txt @@ -0,0 +1,28 @@ + +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( airsync_tests 4 ) +SET( ddf_tests 2 ) +# 2009-Jan-19 bellmich +# All DRMREL 1.0 tests are switched off. +# The background is the extremely bad specification. +# DRMREL 1.0 hardcodes the XML namespace translation. +# I never saw such a broken XML design before. +# +#SET( drmrel_tests 3 ) +SET( emn_tests 17 ) +SET( ota_tests 3 ) +SET( prov_tests 8 ) +SET( si_tests 25 ) +SET( sl_tests 13 ) +SET( syncml_tests 14 ) +SET( wv_tests 116 ) +SET( conml_tests 2 ) +FOREACH( TESTDIR activesync airsync conml ddf emn ota prov si sl syncml wv ) + FOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) + ADD_TEST( "tools_document_${TESTDIR}_${ITEM}" launchTests.sh "${CMAKE_CURRENT_SOURCE_DIR}" "${TESTDIR}" ${ITEM} ) + ENDFOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) +ENDFOREACH( TESTDIR activesync airsync conml ddf emn ota prov si sl syncml wv ) + diff --git a/tests/activesync/activesync-001-settings_device_information.xml b/test/tools/activesync/activesync-001-settings_device_information.xml similarity index 100% rename from tests/activesync/activesync-001-settings_device_information.xml rename to test/tools/activesync/activesync-001-settings_device_information.xml diff --git a/tests/activesync/activesync-002-settings_user_information.xml b/test/tools/activesync/activesync-002-settings_user_information.xml similarity index 100% rename from tests/activesync/activesync-002-settings_user_information.xml rename to test/tools/activesync/activesync-002-settings_user_information.xml diff --git a/tests/activesync/activesync-003-settings_device_password.xml b/test/tools/activesync/activesync-003-settings_device_password.xml similarity index 100% rename from tests/activesync/activesync-003-settings_device_password.xml rename to test/tools/activesync/activesync-003-settings_device_password.xml diff --git a/tests/activesync/activesync-004-settings_oof.xml b/test/tools/activesync/activesync-004-settings_oof.xml similarity index 100% rename from tests/activesync/activesync-004-settings_oof.xml rename to test/tools/activesync/activesync-004-settings_oof.xml diff --git a/tests/activesync/activesync-005-settings_status.xml b/test/tools/activesync/activesync-005-settings_status.xml similarity index 100% rename from tests/activesync/activesync-005-settings_status.xml rename to test/tools/activesync/activesync-005-settings_status.xml diff --git a/tests/activesync/activesync-010-provision-eas.xml b/test/tools/activesync/activesync-010-provision-eas.xml similarity index 100% rename from tests/activesync/activesync-010-provision-eas.xml rename to test/tools/activesync/activesync-010-provision-eas.xml diff --git a/tests/activesync/activesync-011-provision-wap.xml b/test/tools/activesync/activesync-011-provision-wap.xml similarity index 100% rename from tests/activesync/activesync-011-provision-wap.xml rename to test/tools/activesync/activesync-011-provision-wap.xml diff --git a/tests/activesync/activesync-020-folder_sync_initial_request.xml b/test/tools/activesync/activesync-020-folder_sync_initial_request.xml similarity index 100% rename from tests/activesync/activesync-020-folder_sync_initial_request.xml rename to test/tools/activesync/activesync-020-folder_sync_initial_request.xml diff --git a/tests/activesync/activesync-021-folder_sync_initial_response.xml b/test/tools/activesync/activesync-021-folder_sync_initial_response.xml similarity index 100% rename from tests/activesync/activesync-021-folder_sync_initial_response.xml rename to test/tools/activesync/activesync-021-folder_sync_initial_response.xml diff --git a/tests/activesync/activesync-030-sendmail-request.xml b/test/tools/activesync/activesync-030-sendmail-request.xml similarity index 100% rename from tests/activesync/activesync-030-sendmail-request.xml rename to test/tools/activesync/activesync-030-sendmail-request.xml diff --git a/tests/activesync/activesync-031-sendmail-request.xml b/test/tools/activesync/activesync-031-sendmail-request.xml similarity index 100% rename from tests/activesync/activesync-031-sendmail-request.xml rename to test/tools/activesync/activesync-031-sendmail-request.xml diff --git a/tests/activesync/activesync-032-formatted-base64.xml b/test/tools/activesync/activesync-032-formatted-base64.xml similarity index 100% rename from tests/activesync/activesync-032-formatted-base64.xml rename to test/tools/activesync/activesync-032-formatted-base64.xml diff --git a/tests/airsync/airsync-001.xml b/test/tools/airsync/airsync-001.xml similarity index 100% rename from tests/airsync/airsync-001.xml rename to test/tools/airsync/airsync-001.xml diff --git a/tests/airsync/airsync-002-search_query_for_exchange.xml b/test/tools/airsync/airsync-002-search_query_for_exchange.xml similarity index 100% rename from tests/airsync/airsync-002-search_query_for_exchange.xml rename to test/tools/airsync/airsync-002-search_query_for_exchange.xml diff --git a/tests/airsync/airsync-003-search_response_from_exchange.xml b/test/tools/airsync/airsync-003-search_response_from_exchange.xml similarity index 100% rename from tests/airsync/airsync-003-search_response_from_exchange.xml rename to test/tools/airsync/airsync-003-search_response_from_exchange.xml diff --git a/tests/airsync/airsync-004-binary_byte_array.xml b/test/tools/airsync/airsync-004-binary_byte_array.xml similarity index 100% rename from tests/airsync/airsync-004-binary_byte_array.xml rename to test/tools/airsync/airsync-004-binary_byte_array.xml diff --git a/tests/conml/conml-001.xml b/test/tools/conml/conml-001.xml similarity index 100% rename from tests/conml/conml-001.xml rename to test/tools/conml/conml-001.xml diff --git a/tests/conml/conml-002.xml b/test/tools/conml/conml-002.xml similarity index 100% rename from tests/conml/conml-002.xml rename to test/tools/conml/conml-002.xml diff --git a/tests/ddf/ddf-001.ddf b/test/tools/ddf/ddf-001.ddf similarity index 100% rename from tests/ddf/ddf-001.ddf rename to test/tools/ddf/ddf-001.ddf diff --git a/tests/ddf/syncml_with_ddf-001.xml b/test/tools/ddf/syncml_with_ddf-001.xml similarity index 100% rename from tests/ddf/syncml_with_ddf-001.xml rename to test/tools/ddf/syncml_with_ddf-001.xml diff --git a/tests/drmrel/drmrel-001.xml b/test/tools/drmrel/drmrel-001.xml similarity index 100% rename from tests/drmrel/drmrel-001.xml rename to test/tools/drmrel/drmrel-001.xml diff --git a/tests/drmrel/drmrel-002.xml b/test/tools/drmrel/drmrel-002.xml similarity index 100% rename from tests/drmrel/drmrel-002.xml rename to test/tools/drmrel/drmrel-002.xml diff --git a/tests/drmrel/drmrel-003.xml b/test/tools/drmrel/drmrel-003.xml similarity index 100% rename from tests/drmrel/drmrel-003.xml rename to test/tools/drmrel/drmrel-003.xml diff --git a/tests/emn/emn-001.xml b/test/tools/emn/emn-001.xml similarity index 100% rename from tests/emn/emn-001.xml rename to test/tools/emn/emn-001.xml diff --git a/tests/emn/emn-002.xml b/test/tools/emn/emn-002.xml similarity index 100% rename from tests/emn/emn-002.xml rename to test/tools/emn/emn-002.xml diff --git a/tests/emn/emn-003.xml b/test/tools/emn/emn-003.xml similarity index 100% rename from tests/emn/emn-003.xml rename to test/tools/emn/emn-003.xml diff --git a/tests/emn/emn-004.xml b/test/tools/emn/emn-004.xml similarity index 100% rename from tests/emn/emn-004.xml rename to test/tools/emn/emn-004.xml diff --git a/tests/emn/emn-005.xml b/test/tools/emn/emn-005.xml similarity index 100% rename from tests/emn/emn-005.xml rename to test/tools/emn/emn-005.xml diff --git a/tests/emn/emn-006.xml b/test/tools/emn/emn-006.xml similarity index 100% rename from tests/emn/emn-006.xml rename to test/tools/emn/emn-006.xml diff --git a/tests/emn/emn-007.xml b/test/tools/emn/emn-007.xml similarity index 100% rename from tests/emn/emn-007.xml rename to test/tools/emn/emn-007.xml diff --git a/tests/emn/emn-008.xml b/test/tools/emn/emn-008.xml similarity index 100% rename from tests/emn/emn-008.xml rename to test/tools/emn/emn-008.xml diff --git a/tests/emn/emn-009.xml b/test/tools/emn/emn-009.xml similarity index 100% rename from tests/emn/emn-009.xml rename to test/tools/emn/emn-009.xml diff --git a/tests/emn/emn-010.xml b/test/tools/emn/emn-010.xml similarity index 100% rename from tests/emn/emn-010.xml rename to test/tools/emn/emn-010.xml diff --git a/tests/emn/emn-011.xml b/test/tools/emn/emn-011.xml similarity index 100% rename from tests/emn/emn-011.xml rename to test/tools/emn/emn-011.xml diff --git a/tests/emn/emn-012.xml b/test/tools/emn/emn-012.xml similarity index 100% rename from tests/emn/emn-012.xml rename to test/tools/emn/emn-012.xml diff --git a/tests/emn/emn-013.xml b/test/tools/emn/emn-013.xml similarity index 100% rename from tests/emn/emn-013.xml rename to test/tools/emn/emn-013.xml diff --git a/tests/emn/emn-014.xml b/test/tools/emn/emn-014.xml similarity index 100% rename from tests/emn/emn-014.xml rename to test/tools/emn/emn-014.xml diff --git a/tests/emn/emn-015.xml b/test/tools/emn/emn-015.xml similarity index 100% rename from tests/emn/emn-015.xml rename to test/tools/emn/emn-015.xml diff --git a/tests/emn/emn-016.xml b/test/tools/emn/emn-016.xml similarity index 100% rename from tests/emn/emn-016.xml rename to test/tools/emn/emn-016.xml diff --git a/tests/emn/emn-017.xml b/test/tools/emn/emn-017.xml similarity index 100% rename from tests/emn/emn-017.xml rename to test/tools/emn/emn-017.xml diff --git a/tests/launchTests.sh b/test/tools/launchTests.sh similarity index 96% rename from tests/launchTests.sh rename to test/tools/launchTests.sh index e41a749..107c9e7 100755 --- a/tests/launchTests.sh +++ b/test/tools/launchTests.sh @@ -5,8 +5,8 @@ # setup correct path for binaries if they are not in $PATH if [ "${CMAKE_CURRENT_BINARY_DIR}" ] then - WBXML2XML="${CMAKE_CURRENT_BINARY_DIR}/tools/wbxml2xml" - XML2WBXML="${CMAKE_CURRENT_BINARY_DIR}/tools/xml2wbxml" + WBXML2XML="${CMAKE_CURRENT_BINARY_DIR}/../../tools/wbxml2xml" + XML2WBXML="${CMAKE_CURRENT_BINARY_DIR}/../../tools/xml2wbxml" else WBXML2XML=`which wbxml2xml` XML2WBXML=`which xml2wbxml` @@ -45,7 +45,7 @@ fi # Debian does this by default if [ "${CMAKE_SKIP_RPATH}" ] then - LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/src" + LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/../../src" export LD_LIBRARY_PATH fi diff --git a/tests/normalize_xml.pl b/test/tools/normalize_xml.pl similarity index 100% rename from tests/normalize_xml.pl rename to test/tools/normalize_xml.pl diff --git a/tests/ota/ota-001.xml b/test/tools/ota/ota-001.xml similarity index 100% rename from tests/ota/ota-001.xml rename to test/tools/ota/ota-001.xml diff --git a/tests/ota/ota-002.xml b/test/tools/ota/ota-002.xml similarity index 100% rename from tests/ota/ota-002.xml rename to test/tools/ota/ota-002.xml diff --git a/tests/ota/ota-003.xml b/test/tools/ota/ota-003.xml similarity index 100% rename from tests/ota/ota-003.xml rename to test/tools/ota/ota-003.xml diff --git a/tests/prov/prov-001.xml b/test/tools/prov/prov-001.xml similarity index 100% rename from tests/prov/prov-001.xml rename to test/tools/prov/prov-001.xml diff --git a/tests/prov/prov-002.xml b/test/tools/prov/prov-002.xml similarity index 100% rename from tests/prov/prov-002.xml rename to test/tools/prov/prov-002.xml diff --git a/tests/prov/prov-003.xml b/test/tools/prov/prov-003.xml similarity index 100% rename from tests/prov/prov-003.xml rename to test/tools/prov/prov-003.xml diff --git a/tests/prov/prov-004.xml b/test/tools/prov/prov-004.xml similarity index 100% rename from tests/prov/prov-004.xml rename to test/tools/prov/prov-004.xml diff --git a/tests/prov/prov-005.xml b/test/tools/prov/prov-005.xml similarity index 100% rename from tests/prov/prov-005.xml rename to test/tools/prov/prov-005.xml diff --git a/tests/prov/prov-006.xml b/test/tools/prov/prov-006.xml similarity index 100% rename from tests/prov/prov-006.xml rename to test/tools/prov/prov-006.xml diff --git a/tests/prov/prov-007.xml b/test/tools/prov/prov-007.xml similarity index 100% rename from tests/prov/prov-007.xml rename to test/tools/prov/prov-007.xml diff --git a/tests/prov/prov-008.xml b/test/tools/prov/prov-008.xml similarity index 100% rename from tests/prov/prov-008.xml rename to test/tools/prov/prov-008.xml diff --git a/tests/si/si-001.xml b/test/tools/si/si-001.xml similarity index 100% rename from tests/si/si-001.xml rename to test/tools/si/si-001.xml diff --git a/tests/si/si-002.xml b/test/tools/si/si-002.xml similarity index 100% rename from tests/si/si-002.xml rename to test/tools/si/si-002.xml diff --git a/tests/si/si-003.xml b/test/tools/si/si-003.xml similarity index 100% rename from tests/si/si-003.xml rename to test/tools/si/si-003.xml diff --git a/tests/si/si-004.xml b/test/tools/si/si-004.xml similarity index 100% rename from tests/si/si-004.xml rename to test/tools/si/si-004.xml diff --git a/tests/si/si-005.xml b/test/tools/si/si-005.xml similarity index 100% rename from tests/si/si-005.xml rename to test/tools/si/si-005.xml diff --git a/tests/si/si-006.xml b/test/tools/si/si-006.xml similarity index 100% rename from tests/si/si-006.xml rename to test/tools/si/si-006.xml diff --git a/tests/si/si-007.xml b/test/tools/si/si-007.xml similarity index 100% rename from tests/si/si-007.xml rename to test/tools/si/si-007.xml diff --git a/tests/si/si-008.xml b/test/tools/si/si-008.xml similarity index 100% rename from tests/si/si-008.xml rename to test/tools/si/si-008.xml diff --git a/tests/si/si-009.xml b/test/tools/si/si-009.xml similarity index 100% rename from tests/si/si-009.xml rename to test/tools/si/si-009.xml diff --git a/tests/si/si-010.xml b/test/tools/si/si-010.xml similarity index 100% rename from tests/si/si-010.xml rename to test/tools/si/si-010.xml diff --git a/tests/si/si-011.xml b/test/tools/si/si-011.xml similarity index 100% rename from tests/si/si-011.xml rename to test/tools/si/si-011.xml diff --git a/tests/si/si-012.xml b/test/tools/si/si-012.xml similarity index 100% rename from tests/si/si-012.xml rename to test/tools/si/si-012.xml diff --git a/tests/si/si-013.xml b/test/tools/si/si-013.xml similarity index 100% rename from tests/si/si-013.xml rename to test/tools/si/si-013.xml diff --git a/tests/si/si-014.xml b/test/tools/si/si-014.xml similarity index 100% rename from tests/si/si-014.xml rename to test/tools/si/si-014.xml diff --git a/tests/si/si-015.xml b/test/tools/si/si-015.xml similarity index 100% rename from tests/si/si-015.xml rename to test/tools/si/si-015.xml diff --git a/tests/si/si-016.xml b/test/tools/si/si-016.xml similarity index 100% rename from tests/si/si-016.xml rename to test/tools/si/si-016.xml diff --git a/tests/si/si-017.xml b/test/tools/si/si-017.xml similarity index 100% rename from tests/si/si-017.xml rename to test/tools/si/si-017.xml diff --git a/tests/si/si-018.xml b/test/tools/si/si-018.xml similarity index 100% rename from tests/si/si-018.xml rename to test/tools/si/si-018.xml diff --git a/tests/si/si-019.xml b/test/tools/si/si-019.xml similarity index 100% rename from tests/si/si-019.xml rename to test/tools/si/si-019.xml diff --git a/tests/si/si-020.xml b/test/tools/si/si-020.xml similarity index 100% rename from tests/si/si-020.xml rename to test/tools/si/si-020.xml diff --git a/tests/si/si-021.xml b/test/tools/si/si-021.xml similarity index 100% rename from tests/si/si-021.xml rename to test/tools/si/si-021.xml diff --git a/tests/si/si-022.xml b/test/tools/si/si-022.xml similarity index 100% rename from tests/si/si-022.xml rename to test/tools/si/si-022.xml diff --git a/tests/si/si-023.xml b/test/tools/si/si-023.xml similarity index 100% rename from tests/si/si-023.xml rename to test/tools/si/si-023.xml diff --git a/tests/si/si-024.xml b/test/tools/si/si-024.xml similarity index 100% rename from tests/si/si-024.xml rename to test/tools/si/si-024.xml diff --git a/tests/si/si-025.xml b/test/tools/si/si-025.xml similarity index 100% rename from tests/si/si-025.xml rename to test/tools/si/si-025.xml diff --git a/tests/sl/sl-001.xml b/test/tools/sl/sl-001.xml similarity index 100% rename from tests/sl/sl-001.xml rename to test/tools/sl/sl-001.xml diff --git a/tests/sl/sl-002.xml b/test/tools/sl/sl-002.xml similarity index 100% rename from tests/sl/sl-002.xml rename to test/tools/sl/sl-002.xml diff --git a/tests/sl/sl-003.xml b/test/tools/sl/sl-003.xml similarity index 100% rename from tests/sl/sl-003.xml rename to test/tools/sl/sl-003.xml diff --git a/tests/sl/sl-004.xml b/test/tools/sl/sl-004.xml similarity index 100% rename from tests/sl/sl-004.xml rename to test/tools/sl/sl-004.xml diff --git a/tests/sl/sl-005.xml b/test/tools/sl/sl-005.xml similarity index 100% rename from tests/sl/sl-005.xml rename to test/tools/sl/sl-005.xml diff --git a/tests/sl/sl-006.xml b/test/tools/sl/sl-006.xml similarity index 100% rename from tests/sl/sl-006.xml rename to test/tools/sl/sl-006.xml diff --git a/tests/sl/sl-007.xml b/test/tools/sl/sl-007.xml similarity index 100% rename from tests/sl/sl-007.xml rename to test/tools/sl/sl-007.xml diff --git a/tests/sl/sl-008.xml b/test/tools/sl/sl-008.xml similarity index 100% rename from tests/sl/sl-008.xml rename to test/tools/sl/sl-008.xml diff --git a/tests/sl/sl-009.xml b/test/tools/sl/sl-009.xml similarity index 100% rename from tests/sl/sl-009.xml rename to test/tools/sl/sl-009.xml diff --git a/tests/sl/sl-010.xml b/test/tools/sl/sl-010.xml similarity index 100% rename from tests/sl/sl-010.xml rename to test/tools/sl/sl-010.xml diff --git a/tests/sl/sl-011.xml b/test/tools/sl/sl-011.xml similarity index 100% rename from tests/sl/sl-011.xml rename to test/tools/sl/sl-011.xml diff --git a/tests/sl/sl-012.xml b/test/tools/sl/sl-012.xml similarity index 100% rename from tests/sl/sl-012.xml rename to test/tools/sl/sl-012.xml diff --git a/tests/sl/sl-013.xml b/test/tools/sl/sl-013.xml similarity index 100% rename from tests/sl/sl-013.xml rename to test/tools/sl/sl-013.xml diff --git a/tests/syncml/syncml-001.xml b/test/tools/syncml/syncml-001.xml similarity index 100% rename from tests/syncml/syncml-001.xml rename to test/tools/syncml/syncml-001.xml diff --git a/tests/syncml/syncml-002.xml b/test/tools/syncml/syncml-002.xml similarity index 100% rename from tests/syncml/syncml-002.xml rename to test/tools/syncml/syncml-002.xml diff --git a/tests/syncml/syncml-003.xml b/test/tools/syncml/syncml-003.xml similarity index 100% rename from tests/syncml/syncml-003.xml rename to test/tools/syncml/syncml-003.xml diff --git a/tests/syncml/syncml-004.xml b/test/tools/syncml/syncml-004.xml similarity index 100% rename from tests/syncml/syncml-004.xml rename to test/tools/syncml/syncml-004.xml diff --git a/tests/syncml/syncml-005.xml b/test/tools/syncml/syncml-005.xml similarity index 100% rename from tests/syncml/syncml-005.xml rename to test/tools/syncml/syncml-005.xml diff --git a/tests/syncml/syncml-006.xml b/test/tools/syncml/syncml-006.xml similarity index 100% rename from tests/syncml/syncml-006.xml rename to test/tools/syncml/syncml-006.xml diff --git a/tests/syncml/syncml-007.xml b/test/tools/syncml/syncml-007.xml similarity index 100% rename from tests/syncml/syncml-007.xml rename to test/tools/syncml/syncml-007.xml diff --git a/tests/syncml/syncml-008.xml b/test/tools/syncml/syncml-008.xml similarity index 100% rename from tests/syncml/syncml-008.xml rename to test/tools/syncml/syncml-008.xml diff --git a/tests/syncml/syncml-009.xml b/test/tools/syncml/syncml-009.xml similarity index 100% rename from tests/syncml/syncml-009.xml rename to test/tools/syncml/syncml-009.xml diff --git a/tests/syncml/syncml-010.xml b/test/tools/syncml/syncml-010.xml similarity index 100% rename from tests/syncml/syncml-010.xml rename to test/tools/syncml/syncml-010.xml diff --git a/tests/syncml/syncml-011.xml b/test/tools/syncml/syncml-011.xml similarity index 100% rename from tests/syncml/syncml-011.xml rename to test/tools/syncml/syncml-011.xml diff --git a/tests/syncml/syncml-012.xml b/test/tools/syncml/syncml-012.xml similarity index 100% rename from tests/syncml/syncml-012.xml rename to test/tools/syncml/syncml-012.xml diff --git a/tests/syncml/syncml-013.xml b/test/tools/syncml/syncml-013.xml similarity index 100% rename from tests/syncml/syncml-013.xml rename to test/tools/syncml/syncml-013.xml diff --git a/tests/syncml/syncml-014.xml b/test/tools/syncml/syncml-014.xml similarity index 100% rename from tests/syncml/syncml-014.xml rename to test/tools/syncml/syncml-014.xml diff --git a/tests/testsuite.xml b/test/tools/testsuite.xml similarity index 100% rename from tests/testsuite.xml rename to test/tools/testsuite.xml diff --git a/tests/wv/wv-001.xml b/test/tools/wv/wv-001.xml similarity index 100% rename from tests/wv/wv-001.xml rename to test/tools/wv/wv-001.xml diff --git a/tests/wv/wv-002.xml b/test/tools/wv/wv-002.xml similarity index 100% rename from tests/wv/wv-002.xml rename to test/tools/wv/wv-002.xml diff --git a/tests/wv/wv-003.xml b/test/tools/wv/wv-003.xml similarity index 100% rename from tests/wv/wv-003.xml rename to test/tools/wv/wv-003.xml diff --git a/tests/wv/wv-004.xml b/test/tools/wv/wv-004.xml similarity index 100% rename from tests/wv/wv-004.xml rename to test/tools/wv/wv-004.xml diff --git a/tests/wv/wv-005.xml b/test/tools/wv/wv-005.xml similarity index 100% rename from tests/wv/wv-005.xml rename to test/tools/wv/wv-005.xml diff --git a/tests/wv/wv-006.xml b/test/tools/wv/wv-006.xml similarity index 100% rename from tests/wv/wv-006.xml rename to test/tools/wv/wv-006.xml diff --git a/tests/wv/wv-007.xml b/test/tools/wv/wv-007.xml similarity index 100% rename from tests/wv/wv-007.xml rename to test/tools/wv/wv-007.xml diff --git a/tests/wv/wv-008.xml b/test/tools/wv/wv-008.xml similarity index 100% rename from tests/wv/wv-008.xml rename to test/tools/wv/wv-008.xml diff --git a/tests/wv/wv-009.xml b/test/tools/wv/wv-009.xml similarity index 100% rename from tests/wv/wv-009.xml rename to test/tools/wv/wv-009.xml diff --git a/tests/wv/wv-010.xml b/test/tools/wv/wv-010.xml similarity index 100% rename from tests/wv/wv-010.xml rename to test/tools/wv/wv-010.xml diff --git a/tests/wv/wv-011.xml b/test/tools/wv/wv-011.xml similarity index 100% rename from tests/wv/wv-011.xml rename to test/tools/wv/wv-011.xml diff --git a/tests/wv/wv-012.xml b/test/tools/wv/wv-012.xml similarity index 100% rename from tests/wv/wv-012.xml rename to test/tools/wv/wv-012.xml diff --git a/tests/wv/wv-013.xml b/test/tools/wv/wv-013.xml similarity index 100% rename from tests/wv/wv-013.xml rename to test/tools/wv/wv-013.xml diff --git a/tests/wv/wv-014.xml b/test/tools/wv/wv-014.xml similarity index 100% rename from tests/wv/wv-014.xml rename to test/tools/wv/wv-014.xml diff --git a/tests/wv/wv-015.xml b/test/tools/wv/wv-015.xml similarity index 100% rename from tests/wv/wv-015.xml rename to test/tools/wv/wv-015.xml diff --git a/tests/wv/wv-016.xml b/test/tools/wv/wv-016.xml similarity index 100% rename from tests/wv/wv-016.xml rename to test/tools/wv/wv-016.xml diff --git a/tests/wv/wv-017.xml b/test/tools/wv/wv-017.xml similarity index 100% rename from tests/wv/wv-017.xml rename to test/tools/wv/wv-017.xml diff --git a/tests/wv/wv-018.xml b/test/tools/wv/wv-018.xml similarity index 100% rename from tests/wv/wv-018.xml rename to test/tools/wv/wv-018.xml diff --git a/tests/wv/wv-019.xml b/test/tools/wv/wv-019.xml similarity index 100% rename from tests/wv/wv-019.xml rename to test/tools/wv/wv-019.xml diff --git a/tests/wv/wv-020.xml b/test/tools/wv/wv-020.xml similarity index 100% rename from tests/wv/wv-020.xml rename to test/tools/wv/wv-020.xml diff --git a/tests/wv/wv-021.xml b/test/tools/wv/wv-021.xml similarity index 100% rename from tests/wv/wv-021.xml rename to test/tools/wv/wv-021.xml diff --git a/tests/wv/wv-022.xml b/test/tools/wv/wv-022.xml similarity index 100% rename from tests/wv/wv-022.xml rename to test/tools/wv/wv-022.xml diff --git a/tests/wv/wv-023.xml b/test/tools/wv/wv-023.xml similarity index 100% rename from tests/wv/wv-023.xml rename to test/tools/wv/wv-023.xml diff --git a/tests/wv/wv-024.xml b/test/tools/wv/wv-024.xml similarity index 100% rename from tests/wv/wv-024.xml rename to test/tools/wv/wv-024.xml diff --git a/tests/wv/wv-025.xml b/test/tools/wv/wv-025.xml similarity index 100% rename from tests/wv/wv-025.xml rename to test/tools/wv/wv-025.xml diff --git a/tests/wv/wv-026.xml b/test/tools/wv/wv-026.xml similarity index 100% rename from tests/wv/wv-026.xml rename to test/tools/wv/wv-026.xml diff --git a/tests/wv/wv-027.xml b/test/tools/wv/wv-027.xml similarity index 100% rename from tests/wv/wv-027.xml rename to test/tools/wv/wv-027.xml diff --git a/tests/wv/wv-028.xml b/test/tools/wv/wv-028.xml similarity index 100% rename from tests/wv/wv-028.xml rename to test/tools/wv/wv-028.xml diff --git a/tests/wv/wv-029.xml b/test/tools/wv/wv-029.xml similarity index 100% rename from tests/wv/wv-029.xml rename to test/tools/wv/wv-029.xml diff --git a/tests/wv/wv-030.xml b/test/tools/wv/wv-030.xml similarity index 100% rename from tests/wv/wv-030.xml rename to test/tools/wv/wv-030.xml diff --git a/tests/wv/wv-031.xml b/test/tools/wv/wv-031.xml similarity index 100% rename from tests/wv/wv-031.xml rename to test/tools/wv/wv-031.xml diff --git a/tests/wv/wv-032.xml b/test/tools/wv/wv-032.xml similarity index 100% rename from tests/wv/wv-032.xml rename to test/tools/wv/wv-032.xml diff --git a/tests/wv/wv-033.xml b/test/tools/wv/wv-033.xml similarity index 100% rename from tests/wv/wv-033.xml rename to test/tools/wv/wv-033.xml diff --git a/tests/wv/wv-034.xml b/test/tools/wv/wv-034.xml similarity index 100% rename from tests/wv/wv-034.xml rename to test/tools/wv/wv-034.xml diff --git a/tests/wv/wv-035.xml b/test/tools/wv/wv-035.xml similarity index 100% rename from tests/wv/wv-035.xml rename to test/tools/wv/wv-035.xml diff --git a/tests/wv/wv-036.xml b/test/tools/wv/wv-036.xml similarity index 100% rename from tests/wv/wv-036.xml rename to test/tools/wv/wv-036.xml diff --git a/tests/wv/wv-037.xml b/test/tools/wv/wv-037.xml similarity index 100% rename from tests/wv/wv-037.xml rename to test/tools/wv/wv-037.xml diff --git a/tests/wv/wv-038.xml b/test/tools/wv/wv-038.xml similarity index 100% rename from tests/wv/wv-038.xml rename to test/tools/wv/wv-038.xml diff --git a/tests/wv/wv-039.xml b/test/tools/wv/wv-039.xml similarity index 100% rename from tests/wv/wv-039.xml rename to test/tools/wv/wv-039.xml diff --git a/tests/wv/wv-040.xml b/test/tools/wv/wv-040.xml similarity index 100% rename from tests/wv/wv-040.xml rename to test/tools/wv/wv-040.xml diff --git a/tests/wv/wv-041.xml b/test/tools/wv/wv-041.xml similarity index 100% rename from tests/wv/wv-041.xml rename to test/tools/wv/wv-041.xml diff --git a/tests/wv/wv-042.xml b/test/tools/wv/wv-042.xml similarity index 100% rename from tests/wv/wv-042.xml rename to test/tools/wv/wv-042.xml diff --git a/tests/wv/wv-043.xml b/test/tools/wv/wv-043.xml similarity index 100% rename from tests/wv/wv-043.xml rename to test/tools/wv/wv-043.xml diff --git a/tests/wv/wv-044.xml b/test/tools/wv/wv-044.xml similarity index 100% rename from tests/wv/wv-044.xml rename to test/tools/wv/wv-044.xml diff --git a/tests/wv/wv-045.xml b/test/tools/wv/wv-045.xml similarity index 100% rename from tests/wv/wv-045.xml rename to test/tools/wv/wv-045.xml diff --git a/tests/wv/wv-046.xml b/test/tools/wv/wv-046.xml similarity index 100% rename from tests/wv/wv-046.xml rename to test/tools/wv/wv-046.xml diff --git a/tests/wv/wv-047.xml b/test/tools/wv/wv-047.xml similarity index 100% rename from tests/wv/wv-047.xml rename to test/tools/wv/wv-047.xml diff --git a/tests/wv/wv-048.xml b/test/tools/wv/wv-048.xml similarity index 100% rename from tests/wv/wv-048.xml rename to test/tools/wv/wv-048.xml diff --git a/tests/wv/wv-049.xml b/test/tools/wv/wv-049.xml similarity index 100% rename from tests/wv/wv-049.xml rename to test/tools/wv/wv-049.xml diff --git a/tests/wv/wv-050.xml b/test/tools/wv/wv-050.xml similarity index 100% rename from tests/wv/wv-050.xml rename to test/tools/wv/wv-050.xml diff --git a/tests/wv/wv-051.xml b/test/tools/wv/wv-051.xml similarity index 100% rename from tests/wv/wv-051.xml rename to test/tools/wv/wv-051.xml diff --git a/tests/wv/wv-052.xml b/test/tools/wv/wv-052.xml similarity index 100% rename from tests/wv/wv-052.xml rename to test/tools/wv/wv-052.xml diff --git a/tests/wv/wv-053.xml b/test/tools/wv/wv-053.xml similarity index 100% rename from tests/wv/wv-053.xml rename to test/tools/wv/wv-053.xml diff --git a/tests/wv/wv-054.xml b/test/tools/wv/wv-054.xml similarity index 100% rename from tests/wv/wv-054.xml rename to test/tools/wv/wv-054.xml diff --git a/tests/wv/wv-055.xml b/test/tools/wv/wv-055.xml similarity index 100% rename from tests/wv/wv-055.xml rename to test/tools/wv/wv-055.xml diff --git a/tests/wv/wv-056.xml b/test/tools/wv/wv-056.xml similarity index 100% rename from tests/wv/wv-056.xml rename to test/tools/wv/wv-056.xml diff --git a/tests/wv/wv-057.xml b/test/tools/wv/wv-057.xml similarity index 100% rename from tests/wv/wv-057.xml rename to test/tools/wv/wv-057.xml diff --git a/tests/wv/wv-058.xml b/test/tools/wv/wv-058.xml similarity index 100% rename from tests/wv/wv-058.xml rename to test/tools/wv/wv-058.xml diff --git a/tests/wv/wv-059.xml b/test/tools/wv/wv-059.xml similarity index 100% rename from tests/wv/wv-059.xml rename to test/tools/wv/wv-059.xml diff --git a/tests/wv/wv-060.xml b/test/tools/wv/wv-060.xml similarity index 100% rename from tests/wv/wv-060.xml rename to test/tools/wv/wv-060.xml diff --git a/tests/wv/wv-061.xml b/test/tools/wv/wv-061.xml similarity index 100% rename from tests/wv/wv-061.xml rename to test/tools/wv/wv-061.xml diff --git a/tests/wv/wv-062.xml b/test/tools/wv/wv-062.xml similarity index 100% rename from tests/wv/wv-062.xml rename to test/tools/wv/wv-062.xml diff --git a/tests/wv/wv-063.xml b/test/tools/wv/wv-063.xml similarity index 100% rename from tests/wv/wv-063.xml rename to test/tools/wv/wv-063.xml diff --git a/tests/wv/wv-064.xml b/test/tools/wv/wv-064.xml similarity index 100% rename from tests/wv/wv-064.xml rename to test/tools/wv/wv-064.xml diff --git a/tests/wv/wv-065.xml b/test/tools/wv/wv-065.xml similarity index 100% rename from tests/wv/wv-065.xml rename to test/tools/wv/wv-065.xml diff --git a/tests/wv/wv-066.xml b/test/tools/wv/wv-066.xml similarity index 100% rename from tests/wv/wv-066.xml rename to test/tools/wv/wv-066.xml diff --git a/tests/wv/wv-067.xml b/test/tools/wv/wv-067.xml similarity index 100% rename from tests/wv/wv-067.xml rename to test/tools/wv/wv-067.xml diff --git a/tests/wv/wv-068.xml b/test/tools/wv/wv-068.xml similarity index 100% rename from tests/wv/wv-068.xml rename to test/tools/wv/wv-068.xml diff --git a/tests/wv/wv-069.xml b/test/tools/wv/wv-069.xml similarity index 100% rename from tests/wv/wv-069.xml rename to test/tools/wv/wv-069.xml diff --git a/tests/wv/wv-070.xml b/test/tools/wv/wv-070.xml similarity index 100% rename from tests/wv/wv-070.xml rename to test/tools/wv/wv-070.xml diff --git a/tests/wv/wv-071.xml b/test/tools/wv/wv-071.xml similarity index 100% rename from tests/wv/wv-071.xml rename to test/tools/wv/wv-071.xml diff --git a/tests/wv/wv-072.xml b/test/tools/wv/wv-072.xml similarity index 100% rename from tests/wv/wv-072.xml rename to test/tools/wv/wv-072.xml diff --git a/tests/wv/wv-073.xml b/test/tools/wv/wv-073.xml similarity index 100% rename from tests/wv/wv-073.xml rename to test/tools/wv/wv-073.xml diff --git a/tests/wv/wv-074.xml b/test/tools/wv/wv-074.xml similarity index 100% rename from tests/wv/wv-074.xml rename to test/tools/wv/wv-074.xml diff --git a/tests/wv/wv-075.xml b/test/tools/wv/wv-075.xml similarity index 100% rename from tests/wv/wv-075.xml rename to test/tools/wv/wv-075.xml diff --git a/tests/wv/wv-076.xml b/test/tools/wv/wv-076.xml similarity index 100% rename from tests/wv/wv-076.xml rename to test/tools/wv/wv-076.xml diff --git a/tests/wv/wv-077.xml b/test/tools/wv/wv-077.xml similarity index 100% rename from tests/wv/wv-077.xml rename to test/tools/wv/wv-077.xml diff --git a/tests/wv/wv-078.xml b/test/tools/wv/wv-078.xml similarity index 100% rename from tests/wv/wv-078.xml rename to test/tools/wv/wv-078.xml diff --git a/tests/wv/wv-079.xml b/test/tools/wv/wv-079.xml similarity index 100% rename from tests/wv/wv-079.xml rename to test/tools/wv/wv-079.xml diff --git a/tests/wv/wv-080.xml b/test/tools/wv/wv-080.xml similarity index 100% rename from tests/wv/wv-080.xml rename to test/tools/wv/wv-080.xml diff --git a/tests/wv/wv-081.xml b/test/tools/wv/wv-081.xml similarity index 100% rename from tests/wv/wv-081.xml rename to test/tools/wv/wv-081.xml diff --git a/tests/wv/wv-082.xml b/test/tools/wv/wv-082.xml similarity index 100% rename from tests/wv/wv-082.xml rename to test/tools/wv/wv-082.xml diff --git a/tests/wv/wv-083.xml b/test/tools/wv/wv-083.xml similarity index 100% rename from tests/wv/wv-083.xml rename to test/tools/wv/wv-083.xml diff --git a/tests/wv/wv-084.xml b/test/tools/wv/wv-084.xml similarity index 100% rename from tests/wv/wv-084.xml rename to test/tools/wv/wv-084.xml diff --git a/tests/wv/wv-085.xml b/test/tools/wv/wv-085.xml similarity index 100% rename from tests/wv/wv-085.xml rename to test/tools/wv/wv-085.xml diff --git a/tests/wv/wv-086.xml b/test/tools/wv/wv-086.xml similarity index 100% rename from tests/wv/wv-086.xml rename to test/tools/wv/wv-086.xml diff --git a/tests/wv/wv-087.xml b/test/tools/wv/wv-087.xml similarity index 100% rename from tests/wv/wv-087.xml rename to test/tools/wv/wv-087.xml diff --git a/tests/wv/wv-088.xml b/test/tools/wv/wv-088.xml similarity index 100% rename from tests/wv/wv-088.xml rename to test/tools/wv/wv-088.xml diff --git a/tests/wv/wv-089.xml b/test/tools/wv/wv-089.xml similarity index 100% rename from tests/wv/wv-089.xml rename to test/tools/wv/wv-089.xml diff --git a/tests/wv/wv-090.xml b/test/tools/wv/wv-090.xml similarity index 100% rename from tests/wv/wv-090.xml rename to test/tools/wv/wv-090.xml diff --git a/tests/wv/wv-091.xml b/test/tools/wv/wv-091.xml similarity index 100% rename from tests/wv/wv-091.xml rename to test/tools/wv/wv-091.xml diff --git a/tests/wv/wv-092.xml b/test/tools/wv/wv-092.xml similarity index 100% rename from tests/wv/wv-092.xml rename to test/tools/wv/wv-092.xml diff --git a/tests/wv/wv-093.xml b/test/tools/wv/wv-093.xml similarity index 100% rename from tests/wv/wv-093.xml rename to test/tools/wv/wv-093.xml diff --git a/tests/wv/wv-094.xml b/test/tools/wv/wv-094.xml similarity index 100% rename from tests/wv/wv-094.xml rename to test/tools/wv/wv-094.xml diff --git a/tests/wv/wv-095.xml b/test/tools/wv/wv-095.xml similarity index 100% rename from tests/wv/wv-095.xml rename to test/tools/wv/wv-095.xml diff --git a/tests/wv/wv-096.xml b/test/tools/wv/wv-096.xml similarity index 100% rename from tests/wv/wv-096.xml rename to test/tools/wv/wv-096.xml diff --git a/tests/wv/wv-097.xml b/test/tools/wv/wv-097.xml similarity index 100% rename from tests/wv/wv-097.xml rename to test/tools/wv/wv-097.xml diff --git a/tests/wv/wv-098.xml b/test/tools/wv/wv-098.xml similarity index 100% rename from tests/wv/wv-098.xml rename to test/tools/wv/wv-098.xml diff --git a/tests/wv/wv-099.xml b/test/tools/wv/wv-099.xml similarity index 100% rename from tests/wv/wv-099.xml rename to test/tools/wv/wv-099.xml diff --git a/tests/wv/wv-100.xml b/test/tools/wv/wv-100.xml similarity index 100% rename from tests/wv/wv-100.xml rename to test/tools/wv/wv-100.xml diff --git a/tests/wv/wv-101.xml b/test/tools/wv/wv-101.xml similarity index 100% rename from tests/wv/wv-101.xml rename to test/tools/wv/wv-101.xml diff --git a/tests/wv/wv-102.xml b/test/tools/wv/wv-102.xml similarity index 100% rename from tests/wv/wv-102.xml rename to test/tools/wv/wv-102.xml diff --git a/tests/wv/wv-103.xml b/test/tools/wv/wv-103.xml similarity index 100% rename from tests/wv/wv-103.xml rename to test/tools/wv/wv-103.xml diff --git a/tests/wv/wv-104.xml b/test/tools/wv/wv-104.xml similarity index 100% rename from tests/wv/wv-104.xml rename to test/tools/wv/wv-104.xml diff --git a/tests/wv/wv-105.xml b/test/tools/wv/wv-105.xml similarity index 100% rename from tests/wv/wv-105.xml rename to test/tools/wv/wv-105.xml diff --git a/tests/wv/wv-106-datetime.xml b/test/tools/wv/wv-106-datetime.xml similarity index 100% rename from tests/wv/wv-106-datetime.xml rename to test/tools/wv/wv-106-datetime.xml diff --git a/tests/wv/wv-107-datetime.xml b/test/tools/wv/wv-107-datetime.xml similarity index 100% rename from tests/wv/wv-107-datetime.xml rename to test/tools/wv/wv-107-datetime.xml diff --git a/tests/wv/wv-108-datetime.xml b/test/tools/wv/wv-108-datetime.xml similarity index 100% rename from tests/wv/wv-108-datetime.xml rename to test/tools/wv/wv-108-datetime.xml diff --git a/tests/wv/wv-109-datetime.xml b/test/tools/wv/wv-109-datetime.xml similarity index 100% rename from tests/wv/wv-109-datetime.xml rename to test/tools/wv/wv-109-datetime.xml diff --git a/tests/wv/wv-110-datetime.xml b/test/tools/wv/wv-110-datetime.xml similarity index 100% rename from tests/wv/wv-110-datetime.xml rename to test/tools/wv/wv-110-datetime.xml diff --git a/tests/wv/wv-111-datetime.xml b/test/tools/wv/wv-111-datetime.xml similarity index 100% rename from tests/wv/wv-111-datetime.xml rename to test/tools/wv/wv-111-datetime.xml diff --git a/tests/wv/wv-112-datetime.xml b/test/tools/wv/wv-112-datetime.xml similarity index 100% rename from tests/wv/wv-112-datetime.xml rename to test/tools/wv/wv-112-datetime.xml diff --git a/tests/wv/wv-113-datetime.xml b/test/tools/wv/wv-113-datetime.xml similarity index 100% rename from tests/wv/wv-113-datetime.xml rename to test/tools/wv/wv-113-datetime.xml diff --git a/tests/wv/wv-114-datetime.xml b/test/tools/wv/wv-114-datetime.xml similarity index 100% rename from tests/wv/wv-114-datetime.xml rename to test/tools/wv/wv-114-datetime.xml diff --git a/tests/wv/wv-115-datetime.xml b/test/tools/wv/wv-115-datetime.xml similarity index 100% rename from tests/wv/wv-115-datetime.xml rename to test/tools/wv/wv-115-datetime.xml diff --git a/tests/wv/wv-116-datetime.xml b/test/tools/wv/wv-116-datetime.xml similarity index 100% rename from tests/wv/wv-116-datetime.xml rename to test/tools/wv/wv-116-datetime.xml -- 2.34.1