You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2014/08/17 16:45:29 UTC
svn commit: r1618476 [1/3] - in /celix/trunk: cmake/cmake_celix/ framework/
framework/private/mock/ framework/private/src/ framework/private/test/
framework/public/include/
Author: abroekhuis
Date: Sun Aug 17 14:45:28 2014
New Revision: 1618476
URL: http://svn.apache.org/r1618476
Log:
CELIX-139: Updated test to latest CppUTest version with output parameter support. Removed APR from the tests.
Added:
celix/trunk/framework/private/test/wire_test.cpp
- copied, changed from r1617718, celix/trunk/framework/private/test/manifest_parser_test.cpp
Modified:
celix/trunk/cmake/cmake_celix/Test.cmake
celix/trunk/framework/CMakeLists.txt
celix/trunk/framework/private/mock/attribute_mock.c
celix/trunk/framework/private/mock/bundle_archive_mock.c
celix/trunk/framework/private/mock/bundle_context_mock.c
celix/trunk/framework/private/mock/bundle_mock.c
celix/trunk/framework/private/mock/bundle_revision_mock.c
celix/trunk/framework/private/mock/capability_mock.c
celix/trunk/framework/private/mock/framework_mock.c
celix/trunk/framework/private/mock/manifest_mock.c
celix/trunk/framework/private/mock/module_mock.c
celix/trunk/framework/private/mock/requirement_mock.c
celix/trunk/framework/private/mock/service_reference_mock.c
celix/trunk/framework/private/mock/service_registration_mock.c
celix/trunk/framework/private/mock/service_tracker_customizer_mock.c
celix/trunk/framework/private/mock/version_mock.c
celix/trunk/framework/private/mock/version_range_mock.c
celix/trunk/framework/private/src/bundle.c
celix/trunk/framework/private/src/manifest.c
celix/trunk/framework/private/src/service_registration.c
celix/trunk/framework/private/src/service_registry.c
celix/trunk/framework/private/src/version.c
celix/trunk/framework/private/test/bundle_cache_test.cpp
celix/trunk/framework/private/test/bundle_context_test.cpp
celix/trunk/framework/private/test/bundle_revision_test.cpp
celix/trunk/framework/private/test/bundle_test.cpp
celix/trunk/framework/private/test/capability_test.cpp
celix/trunk/framework/private/test/filter_test.cpp
celix/trunk/framework/private/test/framework_test.cpp
celix/trunk/framework/private/test/manifest_parser_test.cpp
celix/trunk/framework/private/test/manifest_test.cpp
celix/trunk/framework/private/test/module_test.cpp
celix/trunk/framework/private/test/properties_test.cpp
celix/trunk/framework/private/test/requirement_test.cpp
celix/trunk/framework/private/test/resolver_test.cpp
celix/trunk/framework/private/test/service_reference_test.cpp
celix/trunk/framework/private/test/service_registration_test.cpp
celix/trunk/framework/private/test/service_registry_test.cpp
celix/trunk/framework/private/test/service_tracker_customizer_test.cpp
celix/trunk/framework/private/test/service_tracker_test.cpp
celix/trunk/framework/private/test/version_range_test.cpp
celix/trunk/framework/private/test/version_test.cpp
celix/trunk/framework/public/include/celix_log.h
Modified: celix/trunk/cmake/cmake_celix/Test.cmake
URL: http://svn.apache.org/viewvc/celix/trunk/cmake/cmake_celix/Test.cmake?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/cmake/cmake_celix/Test.cmake (original)
+++ celix/trunk/cmake/cmake_celix/Test.cmake Sun Aug 17 14:45:28 2014
@@ -16,8 +16,12 @@
# under the License.
FUNCTION(ADD_TARGET_FOR_TEST _testrunner)
- add_test(NAME ${_testrunner}
- COMMAND ${_testrunner} -ojunit)
+ #add_test(NAME ${_testrunner}
+ # COMMAND ${_testrunner} -ojunit)
+
+ ADD_TEST(ctest_build_${_testrunner} "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_testrunner})
+ ADD_TEST(ctest_run_${_testrunner} ${_testrunner} -ojunit)
+ SET_TESTS_PROPERTIES ( ctest_run_${_testrunner} PROPERTIES DEPENDS ctest_build_${_testrunner})
string(LENGTH ${_testrunner} length)
math(EXPR l "${length} - 5")
Modified: celix/trunk/framework/CMakeLists.txt
URL: http://svn.apache.org/viewvc/celix/trunk/framework/CMakeLists.txt?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/CMakeLists.txt (original)
+++ celix/trunk/framework/CMakeLists.txt Sun Aug 17 14:45:28 2014
@@ -84,271 +84,286 @@ if (FRAMEWORK)
include_directories(${CPPUTEST_INCLUDE_DIR})
include_directories(${CPPUTEST_EXT_INCLUDE_DIR})
- add_executable(version_test
- private/test/version_test.cpp
- private/src/version.c
- private/src/celix_errorcodes.c
+ add_executable(attribute_test
+ private/test/attribute_test.cpp
+ private/src/attribute.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c)
+ target_link_libraries(attribute_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(bundle_archive_test
+ private/test/bundle_archive_test.cpp
+ private/mock/bundle_revision_mock.c
+ private/src/bundle_archive.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c)
+ target_link_libraries(bundle_archive_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(bundle_cache_test
+ private/test/bundle_cache_test.cpp
+ private/mock/bundle_archive_mock.c
+ private/mock/properties_mock.c
+ private/src/bundle_cache.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(version_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY})
-
- add_executable(version_range_test
- private/test/version_range_test.cpp
- private/src/version_range.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c)
- target_link_libraries(version_range_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
-
- add_executable(utils_test
- private/test/utils_test.cpp private/src/utils.c
- )
- target_link_libraries(utils_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(service_tracker_test
- private/test/service_tracker_test.cpp
- private/mock/bundle_context_mock.c
- private/mock/service_reference_mock.c
- private/mock/service_tracker_customizer_mock.c
- private/src/service_tracker.c
- private/src/celix_errorcodes.c
+ target_link_libraries(bundle_cache_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(bundle_context_test
+ private/test/bundle_context_test.cpp
+ private/mock/bundle_mock.c
+ private/mock/framework_mock.c
+ private/src/bundle_context.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(service_tracker_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(service_tracker_customizer_test
- private/test/service_tracker_customizer_test.cpp
- private/mock/service_reference_mock.c
- private/src/service_tracker_customizer.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c)
- target_link_libraries(service_tracker_customizer_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(service_registry_test
- private/test/service_registry_test.cpp
- private/mock/framework_mock.c
- private/mock/bundle_mock.c
- private/mock/filter_mock.c
- private/mock/service_reference_mock.c
- private/mock/service_registration_mock.c
- private/mock/properties_mock.c
- private/src/service_registry.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c)
- target_link_libraries(service_registry_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(service_registration_test
- private/test/service_registration_test.cpp
- private/mock/properties_mock.c
- private/mock/service_registry_mock.c
- private/src/service_registration.c
- private/src/celix_errorcodes.c
+ target_link_libraries(bundle_context_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(bundle_revision_test
+ private/test/bundle_revision_test.cpp
+ private/mock/miniunz_mock.c
+ private/mock/manifest_mock.c
+ private/src/bundle_revision.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(service_registration_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(service_reference_test
- private/test/service_reference_test.cpp
- private/mock/service_registration_mock.c
- private/mock/service_registry_mock.c
- private/src/service_reference.c
- private/src/celix_errorcodes.c
+ target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(bundle_test
+ private/test/bundle_test.cpp
+ private/mock/framework_mock.c
+ private/mock/module_mock.c
+ private/mock/bundle_archive_mock.c
+ private/mock/bundle_revision_mock.c
+ private/mock/resolver_mock.c
+ private/mock/version_mock.c
+ private/src/utils.c
+ private/src/bundle.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(service_reference_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(resolver_test
- private/test/resolver_test.cpp
- private/mock/bundle_mock.c
- private/mock/requirement_mock.c
- private/mock/capability_mock.c
- private/mock/module_mock.c
- private/mock/wire_mock.c
- private/src/resolver.c)
- target_link_libraries(resolver_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(requirement_test
- private/test/requirement_test.cpp
- private/mock/attribute_mock.c
- private/mock/capability_mock.c
- private/mock/version_range_mock.c
- private/src/requirement.c
- private/src/celix_errorcodes.c
+ target_link_libraries(bundle_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(capability_test
+ private/test/capability_test.cpp
+ private/mock/attribute_mock.c
+ private/mock/version_mock.c
+ private/src/capability.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(requirement_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(properties_test
- private/test/properties_test.cpp
- private/src/utils.c
- private/src/properties.c)
- target_link_libraries(properties_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(module_test
- private/test/module_test.cpp
- private/mock/bundle_mock.c
- private/mock/version_mock.c
- private/mock/manifest_mock.c
- private/mock/manifest_parser_mock.c
- private/mock/capability_mock.c
- private/mock/wire_mock.c
- private/src/module.c)
- target_link_libraries(module_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(manifest_test
- private/test/manifest_test.cpp
- private/mock/properties_mock.c
- private/src/utils.c
- private/src/manifest.c
- private/src/celix_errorcodes.c
+ target_link_libraries(capability_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(filter_test
+ private/test/filter_test.cpp
+ private/mock/properties_mock.c
+ private/src/filter.c)
+ target_link_libraries(filter_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(framework_test
+ private/test/framework_test.cpp
+ private/mock/properties_mock.c
+ private/mock/resolver_mock.c
+ private/mock/service_reference_mock.c
+ private/mock/service_registry_mock.c
+ private/mock/service_registration_mock.c
+ private/mock/filter_mock.c
+ private/mock/bundle_mock.c
+ private/mock/bundle_context_mock.c
+ private/mock/module_mock.c
+ private/mock/bundle_archive_mock.c
+ private/mock/bundle_revision_mock.c
+ private/mock/bundle_cache_mock.c
+ private/mock/manifest_mock.c
+ private/src/utils.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c
+ private/src/framework.c)
+ target_link_libraries(framework_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${UUID} celix_utils)
+
+ add_executable(manifest_parser_test
+ private/test/manifest_parser_test.cpp
+ private/mock/attribute_mock.c
+ private/mock/manifest_mock.c
+ private/mock/capability_mock.c
+ private/mock/requirement_mock.c
+ private/mock/version_mock.c
+ private/src/utils.c
+ private/src/manifest_parser.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(manifest_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(manifest_parser_test
- private/test/manifest_parser_test.cpp
- private/mock/attribute_mock.c
- private/mock/manifest_mock.c
- private/mock/capability_mock.c
- private/mock/requirement_mock.c
- private/mock/version_mock.c
- private/src/utils.c
- private/src/manifest_parser.c
- private/src/celix_errorcodes.c
+ target_link_libraries(manifest_parser_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(manifest_test
+ private/test/manifest_test.cpp
+ private/mock/properties_mock.c
+ private/src/utils.c
+ private/src/manifest.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(manifest_parser_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(framework_test
- private/test/framework_test.cpp
- private/mock/properties_mock.c
- private/mock/resolver_mock.c
- private/mock/service_reference_mock.c
- private/mock/service_registry_mock.c
- private/mock/service_registration_mock.c
- private/mock/filter_mock.c
- private/mock/bundle_mock.c
- private/mock/bundle_context_mock.c
- private/mock/module_mock.c
- private/mock/bundle_archive_mock.c
- private/mock/bundle_revision_mock.c
- private/mock/bundle_cache_mock.c
- private/mock/manifest_mock.c
- private/src/utils.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c
- private/src/framework.c)
- target_link_libraries(framework_test ${APR_LIBRARY} ${APRUTIL_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${UUID} celix_utils)
-
- add_executable(filter_test
- private/test/filter_test.cpp
- private/mock/properties_mock.c
- private/src/filter.c)
- target_link_libraries(filter_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(capability_test
- private/test/capability_test.cpp
- private/mock/attribute_mock.c
- private/mock/version_mock.c
- private/src/capability.c
- private/src/celix_errorcodes.c
+ target_link_libraries(manifest_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(module_test
+ private/test/module_test.cpp
+ private/mock/bundle_mock.c
+ private/mock/version_mock.c
+ private/mock/manifest_mock.c
+ private/mock/manifest_parser_mock.c
+ private/mock/capability_mock.c
+ private/mock/wire_mock.c
+ private/src/module.c)
+ target_link_libraries(module_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(properties_test
+ private/test/properties_test.cpp
+ private/src/utils.c
+ private/src/properties.c)
+ target_link_libraries(properties_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+
+ add_executable(requirement_test
+ private/test/requirement_test.cpp
+ private/mock/attribute_mock.c
+ private/mock/capability_mock.c
+ private/mock/version_range_mock.c
+ private/src/requirement.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(capability_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(bundle_test
- private/test/bundle_test.cpp
- private/mock/framework_mock.c
- private/mock/module_mock.c
- private/mock/bundle_archive_mock.c
- private/mock/bundle_revision_mock.c
- private/mock/resolver_mock.c
- private/mock/version_mock.c
- private/src/utils.c
- private/src/bundle.c
- private/src/celix_errorcodes.c
+ target_link_libraries(requirement_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(resolver_test
+ private/test/resolver_test.cpp
+ private/mock/bundle_mock.c
+ private/mock/requirement_mock.c
+ private/mock/capability_mock.c
+ private/mock/module_mock.c
+ private/mock/wire_mock.c
+ private/src/resolver.c)
+ target_link_libraries(resolver_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(service_reference_test
+ private/test/service_reference_test.cpp
+ private/mock/service_registration_mock.c
+ private/mock/service_registry_mock.c
+ private/src/service_reference.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(bundle_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(bundle_revision_test
- private/test/bundle_revision_test.cpp
- private/mock/miniunz_mock.c
- private/mock/manifest_mock.c
- private/src/bundle_revision.c
- private/src/celix_errorcodes.c
+ target_link_libraries(service_reference_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(service_registration_test
+ private/test/service_registration_test.cpp
+ private/mock/properties_mock.c
+ private/mock/service_registry_mock.c
+ private/src/service_registration.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(bundle_context_test
- private/test/bundle_context_test.cpp
- private/mock/bundle_mock.c
- private/mock/framework_mock.c
- private/src/bundle_context.c
- private/src/celix_errorcodes.c
+ target_link_libraries(service_registration_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+
+ add_executable(service_registry_test
+ private/test/service_registry_test.cpp
+ private/mock/framework_mock.c
+ private/mock/bundle_mock.c
+ private/mock/filter_mock.c
+ private/mock/service_reference_mock.c
+ private/mock/service_registration_mock.c
+ private/mock/properties_mock.c
+ private/src/service_registry.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c)
+ target_link_libraries(service_registry_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(service_tracker_customizer_test
+ private/test/service_tracker_customizer_test.cpp
+ private/mock/service_reference_mock.c
+ private/src/service_tracker_customizer.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c)
+ target_link_libraries(service_tracker_customizer_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(service_tracker_test
+ private/test/service_tracker_test.cpp
+ private/mock/bundle_context_mock.c
+ private/mock/service_reference_mock.c
+ private/mock/service_tracker_customizer_mock.c
+ private/src/service_tracker.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c)
+ target_link_libraries(service_tracker_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(utils_test
+ private/test/utils_test.cpp private/src/utils.c)
+ target_link_libraries(utils_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+
+ add_executable(version_range_test
+ private/test/version_range_test.cpp
+ private/src/version_range.c
+ private/mock/version_mock.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(bundle_context_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(bundle_cache_test
- private/test/bundle_cache_test.cpp
- private/mock/bundle_archive_mock.c
- private/mock/properties_mock.c
- private/src/bundle_cache.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c)
- target_link_libraries(bundle_cache_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(bundle_archive_test
- private/test/bundle_archive_test.cpp
- private/mock/bundle_revision_mock.c
- private/src/bundle_archive.c
- private/src/celix_errorcodes.c
+ target_link_libraries(version_range_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
+
+ add_executable(version_test
+ private/test/version_test.cpp
+ private/src/version.c
+ private/src/celix_errorcodes.c
private/src/celix_log.c)
- target_link_libraries(bundle_archive_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- add_executable(attribute_test
- private/test/attribute_test.cpp
- private/src/attribute.c
- private/src/celix_errorcodes.c
- private/src/celix_log.c)
- target_link_libraries(attribute_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
-
- ADD_TARGET_FOR_TEST(version_test)
- ADD_TARGET_FOR_TEST(version_range_test)
- ADD_TARGET_FOR_TEST(service_tracker_test)
- ADD_TARGET_FOR_TEST(service_tracker_customizer_test)
- ADD_TARGET_FOR_TEST(service_registry_test)
- ADD_TARGET_FOR_TEST(service_registration_test)
- ADD_TARGET_FOR_TEST(service_reference_test)
- ADD_TARGET_FOR_TEST(resolver_test)
- ADD_TARGET_FOR_TEST(requirement_test)
- ADD_TARGET_FOR_TEST(properties_test)
- ADD_TARGET_FOR_TEST(module_test)
- ADD_TARGET_FOR_TEST(manifest_test)
- ADD_TARGET_FOR_TEST(manifest_parser_test)
- ADD_TARGET_FOR_TEST(framework_test)
- ADD_TARGET_FOR_TEST(filter_test)
- ADD_TARGET_FOR_TEST(capability_test)
- ADD_TARGET_FOR_TEST(bundle_test)
- ADD_TARGET_FOR_TEST(bundle_revision_test)
- ADD_TARGET_FOR_TEST(bundle_context_test)
- ADD_TARGET_FOR_TEST(bundle_cache_test)
- ADD_TARGET_FOR_TEST(bundle_archive_test)
- ADD_TARGET_FOR_TEST(attribute_test)
-
- SETUP_TARGET_FOR_COVERAGE(version_test_c version_test ${CMAKE_BINARY_DIR}/coverage/version_test)
- SETUP_TARGET_FOR_COVERAGE(version_range_test_c version_range_test ${CMAKE_BINARY_DIR}/coverage/version_range_test)
- SETUP_TARGET_FOR_COVERAGE(service_tracker_test_c service_tracker_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_test)
- SETUP_TARGET_FOR_COVERAGE(service_tracker_customizer_test_c service_tracker_customizer_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_customizer_test)
- SETUP_TARGET_FOR_COVERAGE(service_registry_test_c service_registry_test ${CMAKE_BINARY_DIR}/coverage/service_registry_test)
- SETUP_TARGET_FOR_COVERAGE(service_registration_test_c service_registration_test ${CMAKE_BINARY_DIR}/coverage/service_registration_test)
- SETUP_TARGET_FOR_COVERAGE(service_reference_test_c service_reference_test ${CMAKE_BINARY_DIR}/coverage/service_reference_test)
- SETUP_TARGET_FOR_COVERAGE(resolver_test_c resolver_test ${CMAKE_BINARY_DIR}/coverage/resolver_test)
- SETUP_TARGET_FOR_COVERAGE(requirement_test_c requirement_test ${CMAKE_BINARY_DIR}/coverage/requirement_test)
- SETUP_TARGET_FOR_COVERAGE(properties_test_c properties_test ${CMAKE_BINARY_DIR}/coverage/properties_test)
- SETUP_TARGET_FOR_COVERAGE(module_test_c module_test ${CMAKE_BINARY_DIR}/coverage/module_test)
- SETUP_TARGET_FOR_COVERAGE(manifest_test_c manifest_test ${CMAKE_BINARY_DIR}/coverage/manifest_test)
- SETUP_TARGET_FOR_COVERAGE(manifest_parser_test_c manifest_parser_test ${CMAKE_BINARY_DIR}/coverage/manifest_parser_test)
- SETUP_TARGET_FOR_COVERAGE(framework_test_c framework_test ${CMAKE_BINARY_DIR}/coverage/framework_test)
- SETUP_TARGET_FOR_COVERAGE(filter_test_c filter_test ${CMAKE_BINARY_DIR}/coverage/filter_test)
- SETUP_TARGET_FOR_COVERAGE(capability_test_c capability_test ${CMAKE_BINARY_DIR}/coverage/capability_test)
- SETUP_TARGET_FOR_COVERAGE(bundle_test_c bundle_test ${CMAKE_BINARY_DIR}/coverage/bundle_test)
- SETUP_TARGET_FOR_COVERAGE(bundle_revision_test_c bundle_revision_test ${CMAKE_BINARY_DIR}/coverage/bundle_revision_test)
- SETUP_TARGET_FOR_COVERAGE(bundle_context_test_c bundle_context_test ${CMAKE_BINARY_DIR}/coverage/bundle_context_test)
- SETUP_TARGET_FOR_COVERAGE(bundle_cache_test_c bundle_cache_test ${CMAKE_BINARY_DIR}/coverage/bundle_cache_test)
- SETUP_TARGET_FOR_COVERAGE(bundle_archive_test_c bundle_archive_test ${CMAKE_BINARY_DIR}/coverage/bundle_archive_test)
- SETUP_TARGET_FOR_COVERAGE(attribute_test_c attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test)
+ target_link_libraries(version_test ${CPPUTEST_LIBRARY})
+
+ add_executable(wire_test
+ private/mock/requirement_mock.c
+ private/mock/capability_mock.c
+ private/mock/module_mock.c
+ private/src/celix_errorcodes.c
+ private/src/celix_log.c
+ private/src/wire.c
+ private/test/wire_test.cpp)
+ target_link_libraries(wire_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
+
+ set_target_properties(wire_test PROPERTIES COMPILE_FLAGS "-include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorMallocMacros.h -include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorNewMacros.h")
+
+ ADD_TARGET_FOR_TEST(attribute_test)
+ ADD_TARGET_FOR_TEST(bundle_archive_test)
+ #ADD_TARGET_FOR_TEST(bundle_cache_test)
+ ADD_TARGET_FOR_TEST(bundle_context_test)
+ ADD_TARGET_FOR_TEST(bundle_revision_test)
+ ADD_TARGET_FOR_TEST(bundle_test)
+ ADD_TARGET_FOR_TEST(capability_test)
+ ADD_TARGET_FOR_TEST(filter_test)
+ ADD_TARGET_FOR_TEST(framework_test)
+ ADD_TARGET_FOR_TEST(manifest_parser_test)
+ ADD_TARGET_FOR_TEST(manifest_test)
+ ADD_TARGET_FOR_TEST(module_test)
+ ADD_TARGET_FOR_TEST(properties_test)
+ ADD_TARGET_FOR_TEST(requirement_test)
+ ADD_TARGET_FOR_TEST(resolver_test)
+ ADD_TARGET_FOR_TEST(service_reference_test)
+ ADD_TARGET_FOR_TEST(service_registration_test)
+ ADD_TARGET_FOR_TEST(service_registry_test)
+ ADD_TARGET_FOR_TEST(service_tracker_customizer_test)
+ ADD_TARGET_FOR_TEST(service_tracker_test)
+ ADD_TARGET_FOR_TEST(version_range_test)
+ ADD_TARGET_FOR_TEST(version_test)
+ ADD_TARGET_FOR_TEST(wire_test)
+
+ SETUP_TARGET_FOR_COVERAGE(version_test_c version_test ${CMAKE_BINARY_DIR}/coverage/version_test)
+ SETUP_TARGET_FOR_COVERAGE(version_range_test_c version_range_test ${CMAKE_BINARY_DIR}/coverage/version_range_test)
+ SETUP_TARGET_FOR_COVERAGE(service_tracker_test_c service_tracker_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_test)
+ SETUP_TARGET_FOR_COVERAGE(service_tracker_customizer_test_c service_tracker_customizer_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_customizer_test)
+ SETUP_TARGET_FOR_COVERAGE(service_registry_test_c service_registry_test ${CMAKE_BINARY_DIR}/coverage/service_registry_test)
+ SETUP_TARGET_FOR_COVERAGE(service_registration_test_c service_registration_test ${CMAKE_BINARY_DIR}/coverage/service_registration_test)
+ SETUP_TARGET_FOR_COVERAGE(service_reference_test_c service_reference_test ${CMAKE_BINARY_DIR}/coverage/service_reference_test)
+ SETUP_TARGET_FOR_COVERAGE(resolver_test_c resolver_test ${CMAKE_BINARY_DIR}/coverage/resolver_test)
+ SETUP_TARGET_FOR_COVERAGE(requirement_test_c requirement_test ${CMAKE_BINARY_DIR}/coverage/requirement_test)
+ SETUP_TARGET_FOR_COVERAGE(properties_test_c properties_test ${CMAKE_BINARY_DIR}/coverage/properties_test)
+ SETUP_TARGET_FOR_COVERAGE(module_test_c module_test ${CMAKE_BINARY_DIR}/coverage/module_test)
+ SETUP_TARGET_FOR_COVERAGE(manifest_test_c manifest_test ${CMAKE_BINARY_DIR}/coverage/manifest_test)
+ SETUP_TARGET_FOR_COVERAGE(manifest_parser_test_c manifest_parser_test ${CMAKE_BINARY_DIR}/coverage/manifest_parser_test)
+ SETUP_TARGET_FOR_COVERAGE(framework_test_c framework_test ${CMAKE_BINARY_DIR}/coverage/framework_test)
+ SETUP_TARGET_FOR_COVERAGE(filter_test_c filter_test ${CMAKE_BINARY_DIR}/coverage/filter_test)
+ SETUP_TARGET_FOR_COVERAGE(capability_test_c capability_test ${CMAKE_BINARY_DIR}/coverage/capability_test)
+ SETUP_TARGET_FOR_COVERAGE(bundle_test_c bundle_test ${CMAKE_BINARY_DIR}/coverage/bundle_test)
+ SETUP_TARGET_FOR_COVERAGE(bundle_revision_test_c bundle_revision_test ${CMAKE_BINARY_DIR}/coverage/bundle_revision_test)
+ SETUP_TARGET_FOR_COVERAGE(bundle_context_test_c bundle_context_test ${CMAKE_BINARY_DIR}/coverage/bundle_context_test)
+ SETUP_TARGET_FOR_COVERAGE(bundle_cache_test_c bundle_cache_test ${CMAKE_BINARY_DIR}/coverage/bundle_cache_test)
+ SETUP_TARGET_FOR_COVERAGE(bundle_archive_test_c bundle_archive_test ${CMAKE_BINARY_DIR}/coverage/bundle_archive_test)
+ SETUP_TARGET_FOR_COVERAGE(attribute_test_c attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test)
+ SETUP_TARGET_FOR_COVERAGE(wire_test_c wire_test ${CMAKE_BINARY_DIR}/coverage/wire_test)
- add_subdirectory(private/integration-test)
endif (FRAMEWORK_TESTS)
endif (FRAMEWORK)
Modified: celix/trunk/framework/private/mock/attribute_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/attribute_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/attribute_mock.c (original)
+++ celix/trunk/framework/private/mock/attribute_mock.c Sun Aug 17 14:45:28 2014
@@ -31,21 +31,21 @@ celix_status_t attribute_create(char * k
mock_c()->actualCall("attribute_create")
->withStringParameters("key", key)
->withStringParameters("value", value)
- ->_andPointerOutputParameters("attribute", (void **) attribute);
+ ->withOutputParameter("attribute", (void **) attribute);
return mock_c()->returnValue().value.intValue;
}
celix_status_t attribute_getKey(attribute_pt attribute, char **key) {
mock_c()->actualCall("attribute_getKey")
->withPointerParameters("attribute", attribute)
- ->_andStringOutputParameters("key", (const char **) key);
+ ->withOutputParameter("key", (const char **) key);
return mock_c()->returnValue().value.intValue;
}
celix_status_t attribute_getValue(attribute_pt attribute, char **value) {
mock_c()->actualCall("attribute_getValue")
->withPointerParameters("attribute", attribute)
- ->_andStringOutputParameters("value", (const char **) value);
+ ->withOutputParameter("value", (const char **) value);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/bundle_archive_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/bundle_archive_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/bundle_archive_mock.c (original)
+++ celix/trunk/framework/private/mock/bundle_archive_mock.c Sun Aug 17 14:45:28 2014
@@ -34,21 +34,21 @@ celix_status_t bundleArchive_create(fram
->withIntParameters("id", id)
->withStringParameters("location", location)
->withStringParameters("inputFile", inputFile)
- ->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+ ->withOutputParameter("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleArchive_createSystemBundleArchive(framework_logger_pt logger, bundle_archive_pt *bundle_archive) {
mock_c()->actualCall("bundleArchive_createSystemBundleArchive")
->withPointerParameters("logger", logger)
- ->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+ ->withOutputParameter("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleArchive_recreate(char * archiveRoot, bundle_archive_pt *bundle_archive) {
mock_c()->actualCall("bundleArchive_recreate")
->withStringParameters("archiveRoot", archiveRoot)
- ->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+ ->withOutputParameter("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
@@ -60,7 +60,7 @@ celix_status_t bundleArchive_destroy(bun
celix_status_t bundleArchive_getId(bundle_archive_pt archive, long *id) {
mock_c()->actualCall("bundleArchive_getId")
->withPointerParameters("archive", archive)
- ->_andIntOutputParameters("id", (int *) id);
+ ->withOutputParameter("id", id);
return mock_c()->returnValue().value.intValue;
}
@@ -92,7 +92,7 @@ celix_status_t bundleArchive_getRevision
celix_status_t bundleArchive_getCurrentRevision(bundle_archive_pt archive, bundle_revision_pt *revision) {
mock_c()->actualCall("bundleArchive_getCurrentRevision")
->withPointerParameters("archive", archive)
- ->_andPointerOutputParameters("revision", (void **) revision);
+ ->withOutputParameter("revision", (void **) revision);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/bundle_context_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/bundle_context_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/bundle_context_mock.c (original)
+++ celix/trunk/framework/private/mock/bundle_context_mock.c Sun Aug 17 14:45:28 2014
@@ -33,7 +33,7 @@ celix_status_t bundleContext_create(apr_
->withPointerParameters("framework", framework)
->withPointerParameters("logger", logger)
->withPointerParameters("bundle", bundle)
- ->_andPointerOutputParameters("bundle_context", (void **) bundle_context);
+ ->withOutputParameter("bundle_context", (void **) bundle_context);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleContext_destroy(bundle_context_pt context) {
@@ -43,21 +43,21 @@ celix_status_t bundleContext_destroy(bun
celix_status_t bundleContext_getBundle(bundle_context_pt context, bundle_pt *bundle) {
mock_c()->actualCall("bundleContext_getBundle")
->withPointerParameters("context", context)
- ->_andPointerOutputParameters("bundle", (void **) bundle);
+ ->withOutputParameter("bundle", (void **) bundle);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleContext_getFramework(bundle_context_pt context, framework_pt *framework) {
mock_c()->actualCall("bundleContext_getFramework")
->withPointerParameters("context", context)
- ->_andPointerOutputParameters("framework", (void **) framework);
+ ->withOutputParameter("framework", (void **) framework);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleContext_getMemoryPool(bundle_context_pt context, apr_pool_t **memory_pool) {
mock_c()->actualCall("bundleContext_getMemoryPool")
->withPointerParameters("context", context)
- ->_andPointerOutputParameters("memory_pool", (void **) memory_pool);
+ ->withOutputParameter("memory_pool", (void **) memory_pool);
return mock_c()->returnValue().value.intValue;
}
@@ -66,7 +66,7 @@ celix_status_t bundleContext_installBund
mock_c()->actualCall("bundleContext_installBundle")
->withPointerParameters("context", context)
->withStringParameters("location", location)
- ->_andPointerOutputParameters("bundle", (void **) bundle);
+ ->withOutputParameter("bundle", (void **) bundle);
return mock_c()->returnValue().value.intValue;
}
@@ -75,7 +75,7 @@ celix_status_t bundleContext_installBund
->withPointerParameters("context", context)
->withStringParameters("location", location)
->withStringParameters("inputFile", inputFile)
- ->_andPointerOutputParameters("bundle", (void **) bundle);
+ ->withOutputParameter("bundle", (void **) bundle);
return mock_c()->returnValue().value.intValue;
}
@@ -87,7 +87,7 @@ celix_status_t bundleContext_registerSer
->withStringParameters("serviceName", serviceName)
->withPointerParameters("svcObj", svcObj)
->withPointerParameters("properties", properties)
- ->_andPointerOutputParameters("service_registration", (void **) service_registration);
+ ->withOutputParameter("service_registration", (void **) service_registration);
return mock_c()->returnValue().value.intValue;
}
@@ -98,7 +98,7 @@ celix_status_t bundleContext_registerSer
->withStringParameters("serviceName", serviceName)
->withPointerParameters("factory", factory)
->withPointerParameters("properties", properties)
- ->_andPointerOutputParameters("service_registration", (void **) service_registration);
+ ->withOutputParameter("service_registration", (void **) service_registration);
return mock_c()->returnValue().value.intValue;
}
@@ -108,7 +108,7 @@ celix_status_t bundleContext_getServiceR
->withPointerParameters("context", context)
->withStringParameters("serviceName", serviceName)
->withStringParameters("filter", filter)
- ->_andPointerOutputParameters("service_references", (void **) service_references);
+ ->withOutputParameter("service_references", (void **) service_references);
return mock_c()->returnValue().value.intValue;
}
@@ -116,7 +116,7 @@ celix_status_t bundleContext_getServiceR
mock_c()->actualCall("bundleContext_getServiceReference")
->withPointerParameters("context", context)
->withStringParameters("serviceName", serviceName)
- ->_andPointerOutputParameters("service_reference", (void **) service_reference);
+ ->withOutputParameter("service_reference", (void **) service_reference);
return mock_c()->returnValue().value.intValue;
}
@@ -125,7 +125,7 @@ celix_status_t bundleContext_getService(
mock_c()->actualCall("bundleContext_getService")
->withPointerParameters("context", context)
->withPointerParameters("reference", reference)
- ->_andPointerOutputParameters("service_instance", (void **) service_instance);
+ ->withOutputParameter("service_instance", (void **) service_instance);
return mock_c()->returnValue().value.intValue;
}
@@ -133,7 +133,7 @@ celix_status_t bundleContext_ungetServic
mock_c()->actualCall("bundleContext_ungetService")
->withPointerParameters("context", context)
->withPointerParameters("reference", reference)
- ->_andIntOutputParameters("result", (int *) result);
+ ->withOutputParameter("result", (int *) result);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/bundle_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/bundle_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/bundle_mock.c (original)
+++ celix/trunk/framework/private/mock/bundle_mock.c Sun Aug 17 14:45:28 2014
@@ -51,7 +51,7 @@ celix_status_t bundle_getArchive(bundle_
celix_status_t bundle_getCurrentModule(bundle_pt bundle, module_pt *module) {
mock_c()->actualCall("bundle_getCurrentModule")
->withPointerParameters("bundle", bundle)
- ->_andPointerOutputParameters("module", (void **) module);
+ ->withOutputParameter("module", (void **) module);
return mock_c()->returnValue().value.intValue;
}
@@ -203,7 +203,7 @@ celix_status_t bundle_getServicesInUse(b
celix_status_t bundle_getMemoryPool(bundle_pt bundle, apr_pool_t **pool) {
mock_c()->actualCall("bundle_getMemoryPool")
->withPointerParameters("bundle", bundle)
- ->_andPointerOutputParameters("pool", (void **) pool);
+ ->withOutputParameter("pool", (void **) pool);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/bundle_revision_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/bundle_revision_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/bundle_revision_mock.c (original)
+++ celix/trunk/framework/private/mock/bundle_revision_mock.c Sun Aug 17 14:45:28 2014
@@ -55,14 +55,14 @@ celix_status_t bundleRevision_getRoot(bu
celix_status_t bundleRevision_getManifest(bundle_revision_pt revision, manifest_pt *manifest) {
mock_c()->actualCall("bundleRevision_getManifest")
->withPointerParameters("revision", revision)
- ->_andPointerOutputParameters("manifest", (void **) manifest);
+ ->withOutputParameter("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
celix_status_t bundleRevision_getHandles(bundle_revision_pt revision, array_list_pt *handles) {
mock_c()->actualCall("bundleRevision_getHandles")
->withPointerParameters("revision", revision)
- ->_andPointerOutputParameters("handles", (void **) handles);
+ ->withOutputParameter("handles", (void **) handles);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/capability_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/capability_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/capability_mock.c (original)
+++ celix/trunk/framework/private/mock/capability_mock.c Sun Aug 17 14:45:28 2014
@@ -40,7 +40,7 @@ celix_status_t capability_getServiceName
celix_status_t capability_getVersion(capability_pt capability, version_pt *version) {
mock_c()->actualCall("capability_getVersion")
->withPointerParameters("capability", capability)
- ->_andPointerOutputParameters("version", (void **) version);
+ ->withOutputParameter("version", (void **) version);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/framework_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/framework_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/framework_mock.c (original)
+++ celix/trunk/framework/private/mock/framework_mock.c Sun Aug 17 14:45:28 2014
@@ -55,7 +55,7 @@ celix_status_t fw_getProperty(framework_
mock_c()->actualCall("fw_getProperty")
->withPointerParameters("framework", framework)
->withStringParameters("name", name)
- ->_andStringOutputParameters("value", (const char **) value);
+ ->withOutputParameter("value", (const char **) value);
return mock_c()->returnValue().value.intValue;
}
@@ -64,7 +64,7 @@ celix_status_t fw_installBundle(framewor
->withPointerParameters("framework", framework)
->withStringParameters("location", location)
->withStringParameters("inputFile", inputFile)
- ->_andPointerOutputParameters("bundle", (void **) bundle);
+ ->withOutputParameter("bundle", (void **) bundle);
return mock_c()->returnValue().value.intValue;
}
@@ -80,7 +80,7 @@ celix_status_t framework_getBundleEntry(
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
->withStringParameters("name", name)
- ->_andStringOutputParameters("entry", (const char **) entry);
+ ->withOutputParameter("entry", (const char **) entry);
return mock_c()->returnValue().value.intValue;
}
@@ -117,7 +117,7 @@ celix_status_t fw_registerService(framew
->withStringParameters("serviceName", serviceName)
->withPointerParameters("service", svcObj)
->withPointerParameters("properties", properties)
- ->_andPointerOutputParameters("registration", (void **) registration);
+ ->withOutputParameter("registration", (void **) registration);
return mock_c()->returnValue().value.intValue;
}
@@ -128,7 +128,7 @@ celix_status_t fw_registerServiceFactory
->withStringParameters("serviceName", serviceName)
->withPointerParameters("serviceFactory", factory)
->withPointerParameters("properties", properties)
- ->_andPointerOutputParameters("registration", (void **) registration);
+ ->withOutputParameter("registration", (void **) registration);
return mock_c()->returnValue().value.intValue;
}
@@ -143,7 +143,7 @@ celix_status_t fw_getServiceReferences(f
->withPointerParameters("bundle", bundle)
->withStringParameters("serviceName", serviceName)
->withStringParameters("filter", filter)
- ->_andPointerOutputParameters("references", (void **) references);
+ ->withOutputParameter("references", (void **) references);
return mock_c()->returnValue().value.intValue;
}
@@ -152,7 +152,7 @@ celix_status_t fw_getService(framework_p
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
->withPointerParameters("reference", reference)
- ->_andPointerOutputParameters("service", service);
+ ->withOutputParameter("service", service);
return mock_c()->returnValue().value.intValue;
}
@@ -161,7 +161,7 @@ celix_status_t framework_ungetService(fr
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
->withPointerParameters("reference", reference)
- ->_andIntOutputParameters("result", (int *) result);
+ ->withOutputParameter("result", (int *) result);
return mock_c()->returnValue().value.intValue;
}
@@ -242,7 +242,7 @@ celix_status_t fw_isServiceAssignable(fr
celix_status_t getManifest(bundle_archive_pt archive, manifest_pt *manifest) {
mock_c()->actualCall("getManifest")
->withPointerParameters("archive", archive)
- ->_andPointerOutputParameters("manifest", (void **) manifest);
+ ->withOutputParameter("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
@@ -293,14 +293,6 @@ bundle_pt framework_getBundleById(framew
return mock_c()->returnValue().value.pointerValue;
}
-
-celix_status_t framework_getMemoryPool(framework_pt framework, apr_pool_t **pool) {
- mock_c()->actualCall("framework_getMemoryPool")
- ->withPointerParameters("framework", framework)
- ->_andPointerOutputParameters("pool", (void **) pool);
- return mock_c()->returnValue().value.intValue;
-}
-
celix_status_t framework_getFrameworkBundle(framework_pt framework, bundle_pt *bundle) {
mock_c()->actualCall("framework_getFrameworkBundle");
return mock_c()->returnValue().value.intValue;
Modified: celix/trunk/framework/private/mock/manifest_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/manifest_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/manifest_mock.c (original)
+++ celix/trunk/framework/private/mock/manifest_mock.c Sun Aug 17 14:45:28 2014
@@ -29,14 +29,14 @@
celix_status_t manifest_create(manifest_pt *manifest) {
mock_c()->actualCall("manifest_create")
- ->_andPointerOutputParameters("manifest", (void **) manifest);
+ ->withOutputParameter("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
celix_status_t manifest_createFromFile(char *filename, manifest_pt *manifest) {
mock_c()->actualCall("manifest_createFromFile")
->withStringParameters("filename", filename)
- ->_andPointerOutputParameters("manifest", (void **) manifest);
+ ->withOutputParameter("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/module_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/module_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/module_mock.c (original)
+++ celix/trunk/framework/private/mock/module_mock.c Sun Aug 17 14:45:28 2014
@@ -69,7 +69,7 @@ version_pt module_getVersion(module_pt m
celix_status_t module_getSymbolicName(module_pt module, char **symbolicName) {
mock_c()->actualCall("module_getSymbolicName")
->withPointerParameters("module", module)
- ->_andStringOutputParameters("symbolicName", (const char **) symbolicName);
+ ->withOutputParameter("symbolicName", (const char **) symbolicName);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/requirement_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/requirement_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/requirement_mock.c (original)
+++ celix/trunk/framework/private/mock/requirement_mock.c Sun Aug 17 14:45:28 2014
@@ -31,7 +31,8 @@ celix_status_t requirement_create(hash_m
mock_c()->actualCall("requirement_create")
->withPointerParameters("directives", directives)
->withPointerParameters("attributes", attributes)
- ->_andPointerOutputParameters("requirement", (void **) requirement);
+ ->withOutputParameter("requirement", (void **) requirement);
+// ->_andPointerOutputParameters("requirement", (void **) requirement);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/service_reference_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/service_reference_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/service_reference_mock.c (original)
+++ celix/trunk/framework/private/mock/service_reference_mock.c Sun Aug 17 14:45:28 2014
@@ -31,7 +31,7 @@ celix_status_t serviceReference_create(b
mock_c()->actualCall("serviceReference_create")
->withPointerParameters("bundle", bundle)
->withPointerParameters("registration", registration)
- ->_andPointerOutputParameters("reference", (void **) reference);
+ ->withOutputParameter("reference", (void **) reference);
return mock_c()->returnValue().value.intValue;
}
@@ -50,7 +50,7 @@ celix_status_t serviceReference_invalida
celix_status_t serviceReference_getServiceRegistration(service_reference_pt reference, service_registration_pt *registration) {
mock_c()->actualCall("serviceReference_getServiceRegistration")
->withPointerParameters("reference", reference)
- ->_andPointerOutputParameters("registration", (void **) registration);
+ ->withOutputParameter("registration", (void **) registration);
return mock_c()->returnValue().value.intValue;
}
@@ -73,7 +73,7 @@ celix_status_t serviceReference_equals(s
mock_c()->actualCall("serviceReference_equals")
->withPointerParameters("reference", reference)
->withPointerParameters("compareTo", compareTo)
- ->_andIntOutputParameters("equal", (int *) equal);
+ ->withOutputParameter("equal", equal);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/service_registration_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/service_registration_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/service_registration_mock.c (original)
+++ celix/trunk/framework/private/mock/service_registration_mock.c Sun Aug 17 14:45:28 2014
@@ -76,7 +76,7 @@ celix_status_t serviceRegistration_getSe
mock_c()->actualCall("serviceRegistration_getService")
->withPointerParameters("registration", registration)
->withPointerParameters("bundle", bundle)
- ->_andPointerOutputParameters("service", (void **) service);
+ ->withOutputParameter("service", (void **) service);
return mock_c()->returnValue().value.intValue;
}
@@ -84,35 +84,35 @@ celix_status_t serviceRegistration_getSe
celix_status_t serviceRegistration_getProperties(service_registration_pt registration, properties_pt *properties) {
mock_c()->actualCall("serviceRegistration_getProperties")
->withPointerParameters("registration", registration)
- ->_andPointerOutputParameters("properties", (void **) properties);
+ ->withOutputParameter("properties", (void **) properties);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceRegistration_getRegistry(service_registration_pt registration, service_registry_pt *registry) {
mock_c()->actualCall("serviceRegistration_getRegistry")
->withPointerParameters("registration", registration)
- ->_andPointerOutputParameters("registry", (void **) registry);
+ ->withOutputParameter("registry", (void **) registry);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceRegistration_getServiceReferences(service_registration_pt registration, array_list_pt *references) {
mock_c()->actualCall("serviceRegistration_getServiceReferences")
->withPointerParameters("registration", registration)
- ->_andPointerOutputParameters("references", (void **) references);
+ ->withOutputParameter("references", references);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceRegistration_getBundle(service_registration_pt registration, bundle_pt *bundle) {
mock_c()->actualCall("serviceRegistration_getBundle")
->withPointerParameters("registration", registration)
- ->_andPointerOutputParameters("bundle", (void **) bundle);
+ ->withOutputParameter("bundle", (void **) bundle);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceRegistration_getServiceName(service_registration_pt registration, char **serviceName) {
mock_c()->actualCall("serviceRegistration_getServiceName")
->withPointerParameters("registration", registration)
- ->_andStringOutputParameters("serviceName", (const char **) serviceName);
+ ->withOutputParameter("serviceName", (const char **) serviceName);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/service_tracker_customizer_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/service_tracker_customizer_mock.c (original)
+++ celix/trunk/framework/private/mock/service_tracker_customizer_mock.c Sun Aug 17 14:45:28 2014
@@ -38,35 +38,35 @@ celix_status_t serviceTrackerCustomizer_
celix_status_t serviceTrackerCustomizer_getHandle(service_tracker_customizer_pt customizer, void **handle) {
mock_c()->actualCall("serviceTrackerCustomizer_getHandle")
->withPointerParameters("customizer", customizer)
- ->_andPointerOutputParameters("handle", handle);
+ ->withOutputParameter("handle", handle);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceTrackerCustomizer_getAddingFunction(service_tracker_customizer_pt customizer, adding_callback_pt *function) {
mock_c()->actualCall("serviceTrackerCustomizer_getAddingFunction")
->withPointerParameters("customizer", customizer)
- ->_andPointerOutputParameters("function", (void **) function);
+ ->withOutputParameter("function", (void **) function);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceTrackerCustomizer_getAddedFunction(service_tracker_customizer_pt customizer, added_callback_pt *function) {
mock_c()->actualCall("serviceTrackerCustomizer_getAddedFunction")
->withPointerParameters("customizer", customizer)
- ->_andPointerOutputParameters("function", (void **) function);
+ ->withOutputParameter("function", (void **) function);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceTrackerCustomizer_getModifiedFunction(service_tracker_customizer_pt customizer, modified_callback_pt *function) {
mock_c()->actualCall("serviceTrackerCustomizer_getModifiedFunction")
->withPointerParameters("customizer", customizer)
- ->_andPointerOutputParameters("function", (void **) function);
+ ->withOutputParameter("function", (void **) function);
return mock_c()->returnValue().value.intValue;
}
celix_status_t serviceTrackerCustomizer_getRemovedFunction(service_tracker_customizer_pt customizer, removed_callback_pt *function) {
mock_c()->actualCall("serviceTrackerCustomizer_getRemovedFunction")
->withPointerParameters("customizer", customizer)
- ->_andPointerOutputParameters("function", (void **) function);
+ ->withOutputParameter("function", (void **) function);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/mock/version_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/version_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/version_mock.c (original)
+++ celix/trunk/framework/private/mock/version_mock.c Sun Aug 17 14:45:28 2014
@@ -45,13 +45,13 @@ celix_status_t version_clone(version_pt
celix_status_t version_createVersionFromString(char * versionStr, version_pt *version) {
mock_c()->actualCall("version_createVersionFromString")
->withStringParameters("versionStr", versionStr)
- ->_andPointerOutputParameters("version", (void **) version);
+ ->withOutputParameter("version", (void **) version);
return mock_c()->returnValue().value.intValue;
}
celix_status_t version_createEmptyVersion(version_pt *version) {
mock_c()->actualCall("version_createEmptyVersion")
- ->_andPointerOutputParameters("version", (void **) version);
+ ->withOutputParameter("version", (void **) version);
return mock_c()->returnValue().value.intValue;
}
@@ -76,10 +76,14 @@ celix_status_t version_getQualifier(vers
}
celix_status_t version_compareTo(version_pt version, version_pt compare, int *result) {
- mock_c()->actualCall("version_compareTo");
- return mock_c()->returnValue().value.intValue;
+ mock_c()->actualCall("version_compareTo")
+ ->withPointerParameters("version", version)
+ ->withPointerParameters("compare", compare)
+ ->withOutputParameter("result", result);
+ return CELIX_SUCCESS;
}
+
celix_status_t version_toString(version_pt version, char **string) {
mock_c()->actualCall("version_toString");
return mock_c()->returnValue().value.intValue;
Modified: celix/trunk/framework/private/mock/version_range_mock.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/mock/version_range_mock.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/mock/version_range_mock.c (original)
+++ celix/trunk/framework/private/mock/version_range_mock.c Sun Aug 17 14:45:28 2014
@@ -34,7 +34,7 @@ celix_status_t versionRange_createVersio
celix_status_t versionRange_createInfiniteVersionRange(version_range_pt *range) {
mock_c()->actualCall("versionRange_createInfiniteVersionRange")
- ->_andPointerOutputParameters("range", (void **) range);
+ ->withOutputParameter("range", (void **) range);
return mock_c()->returnValue().value.intValue;
}
@@ -42,14 +42,14 @@ celix_status_t versionRange_isInRange(ve
mock_c()->actualCall("versionRange_isInRange")
->withPointerParameters("versionRange", versionRange)
->withPointerParameters("version", version)
- ->_andIntOutputParameters("inRange", (int *) inRange);
+ ->withOutputParameter("inRange", (int *) inRange);
return mock_c()->returnValue().value.intValue;
}
celix_status_t versionRange_parse(char * rangeStr, version_range_pt *range) {
mock_c()->actualCall("versionRange_parse")
->withStringParameters("rangeStr", rangeStr)
- ->_andPointerOutputParameters("range", (void **) range);
+ ->withOutputParameter("range", (void **) range);
return mock_c()->returnValue().value.intValue;
}
Modified: celix/trunk/framework/private/src/bundle.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/bundle.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/src/bundle.c (original)
+++ celix/trunk/framework/private/src/bundle.c Sun Aug 17 14:45:28 2014
@@ -60,6 +60,8 @@ celix_status_t bundle_create(bundle_pt *
(*bundle)->state = OSGI_FRAMEWORK_BUNDLE_INSTALLED;
(*bundle)->modules = NULL;
arrayList_create(&(*bundle)->modules);
+ (*bundle)->handle = NULL;
+ (*bundle)->manifest = NULL;
module = module_createFrameworkModule((*bundle));
bundle_addModule(*bundle, module);
Modified: celix/trunk/framework/private/src/manifest.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/manifest.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/src/manifest.c (original)
+++ celix/trunk/framework/private/src/manifest.c Sun Aug 17 14:45:28 2014
@@ -53,7 +53,7 @@ celix_status_t manifest_create(manifest_
celix_status_t manifest_destroy(manifest_pt manifest) {
if (manifest != NULL) {
- hashMap_destroy(manifest->mainAttributes, true, true);
+ properties_destroy(manifest->mainAttributes);
hashMap_destroy(manifest->attributes, true, false);
manifest->mainAttributes = NULL;
manifest->attributes = NULL;
@@ -99,6 +99,7 @@ celix_status_t manifest_read(manifest_pt
char name[512];
bool skipEmptyLines = true;
char lastline[512];
+ name[0] = '\0';
manifest_readAttributes(manifest, manifest->mainAttributes, file);
@@ -164,6 +165,7 @@ celix_status_t manifest_read(manifest_pt
}
manifest_readAttributes(manifest, attributes, file);
+ name[0] = '\0';
skipEmptyLines = true;
}
fclose(file);
Modified: celix/trunk/framework/private/src/service_registration.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/service_registration.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/src/service_registration.c (original)
+++ celix/trunk/framework/private/src/service_registration.c Sun Aug 17 14:45:28 2014
@@ -57,6 +57,8 @@ celix_status_t serviceRegistration_creat
*registration = malloc(sizeof(**registration));
if (*registration) {
+ (*registration)->services = NULL;
+ (*registration)->nrOfServices = 0;
(*registration)->isServiceFactory = isFactory;
(*registration)->registry = registry;
(*registration)->className = strdup(serviceName);
Modified: celix/trunk/framework/private/src/service_registry.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/service_registry.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/src/service_registry.c (original)
+++ celix/trunk/framework/private/src/service_registry.c Sun Aug 17 14:45:28 2014
@@ -54,6 +54,7 @@ celix_status_t serviceRegistry_create(fr
(*registry)->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL);
(*registry)->framework = framework;
(*registry)->currentServiceId = 1l;
+ (*registry)->serviceReferences = NULL;
arrayList_create(&(*registry)->listenerHooks);
Modified: celix/trunk/framework/private/src/version.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/version.c?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/src/version.c (original)
+++ celix/trunk/framework/private/src/version.c Sun Aug 17 14:45:28 2014
@@ -245,14 +245,14 @@ celix_status_t version_toString(version_
if (written >= 512 || written < 0) {
status = CELIX_BUNDLE_EXCEPTION;
}
- *string = str;
+ *string = strdup(str);
} else {
char str[512];
int written = snprintf(str, 512, "%d.%d.%d", version->major, version->minor, version->micro);
if (written >= 512 || written < 0) {
status = CELIX_BUNDLE_EXCEPTION;
}
- *string = str;
+ *string = strdup(str);
}
return status;
}
Modified: celix/trunk/framework/private/test/bundle_cache_test.cpp
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/test/bundle_cache_test.cpp?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/test/bundle_cache_test.cpp (original)
+++ celix/trunk/framework/private/test/bundle_cache_test.cpp Sun Aug 17 14:45:28 2014
@@ -25,6 +25,8 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "CppUTest/TestHarness.h"
#include "CppUTest/TestHarness_c.h"
@@ -32,7 +34,6 @@
#include "CppUTestExt/MockSupport.h"
extern "C" {
-#include <apr_file_io.h>
#include "bundle_cache_private.h"
#include "celix_log.h"
@@ -44,18 +45,12 @@ int main(int argc, char** argv) {
}
TEST_GROUP(bundle_cache) {
- apr_pool_t *pool;
-
void setup(void) {
- apr_initialize();
- apr_pool_create(&pool, NULL);
-
- logger = (framework_logger_pt) apr_palloc(pool, sizeof(*logger));
+ logger = (framework_logger_pt) malloc(sizeof(*logger));
logger->logFunction = frameworkLogger_log;
}
void teardown() {
- apr_pool_destroy(pool);
mock().checkExpectations();
mock().clear();
}
@@ -75,14 +70,13 @@ TEST(bundle_cache, create) {
}
TEST(bundle_cache, deleteTree) {
- bundle_cache_pt cache = (bundle_cache_pt) apr_palloc(pool, sizeof(*cache));
+ bundle_cache_pt cache = (bundle_cache_pt) malloc(sizeof(*cache));
char cacheDir[] = "bundle_cache_test_directory";
char cacheFile[] = "bundle_cache_test_directory/temp";
cache->cacheDir = cacheDir;
- apr_dir_make(cacheDir, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
- apr_file_t *file;
- apr_file_mktemp(&file, cacheFile, APR_UREAD|APR_UWRITE, pool);
+ mkdir(cacheDir, S_IRWXU);
+ mktemp(cacheFile);
celix_status_t status = bundleCache_delete(cache);
@@ -91,21 +85,20 @@ TEST(bundle_cache, deleteTree) {
}
TEST(bundle_cache, getArchive) {
- bundle_cache_pt cache = (bundle_cache_pt) apr_palloc(pool, sizeof(*cache));
+ bundle_cache_pt cache = (bundle_cache_pt) malloc(sizeof(*cache));
char cacheDir[] = "bundle_cache_test_directory";
cache->cacheDir = cacheDir;
char bundle0[] = "bundle_cache_test_directory/bundle0";
char bundle1[] = "bundle_cache_test_directory/bundle1";
- apr_dir_make(cacheDir, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
- apr_dir_make(bundle0, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
- apr_dir_make(bundle1, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
+ mkdir(cacheDir, S_IRWXU);
+ mkdir(bundle0, S_IRWXU);
+ mkdir(bundle1, S_IRWXU);
bundle_archive_pt archive = (bundle_archive_pt) 0x10;
mock().expectOneCall("bundleArchive_recreate")
.withParameter("archiveRoot", bundle1)
- .withParameter("mp", pool)
- .andOutputParameter("bundle_archive", archive)
+ .withOutputParameterReturning("bundle_archive", &archive, sizeof(archive))
.andReturnValue(CELIX_SUCCESS);
array_list_pt archives = NULL;
@@ -116,13 +109,13 @@ TEST(bundle_cache, getArchive) {
LONGS_EQUAL(1, arrayList_size(archives));
POINTERS_EQUAL(archive, arrayList_get(archives, 0));
- apr_dir_remove(bundle0, pool);
- apr_dir_remove(bundle1, pool);
- apr_dir_remove(cacheDir, pool);
+ rmdir(bundle0);
+ rmdir(bundle1);
+ rmdir(cacheDir);
}
TEST(bundle_cache, createArchive) {
- bundle_cache_pt cache = (bundle_cache_pt) apr_palloc(pool, sizeof(*cache));
+ bundle_cache_pt cache = (bundle_cache_pt) malloc(sizeof(*cache));
char cacheDir[] = "bundle_cache_test_directory";
cache->cacheDir = cacheDir;
@@ -136,8 +129,7 @@ TEST(bundle_cache, createArchive) {
.withParameter("id", id)
.withParameter("location", location)
.withParameter("inputFile", (char *) NULL)
- .withParameter("mp", pool)
- .andOutputParameter("bundle_archive", archive)
+ .withOutputParameterReturning("bundle_archive", &archive, sizeof(archive))
.andReturnValue(CELIX_SUCCESS);
bundle_archive_pt actual;
Modified: celix/trunk/framework/private/test/bundle_context_test.cpp
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/test/bundle_context_test.cpp?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/test/bundle_context_test.cpp (original)
+++ celix/trunk/framework/private/test/bundle_context_test.cpp Sun Aug 17 14:45:28 2014
@@ -43,18 +43,12 @@ int main(int argc, char** argv) {
}
TEST_GROUP(bundle_context) {
- apr_pool_t *pool;
-
void setup(void) {
- apr_initialize();
- apr_pool_create(&pool, NULL);
-
- logger = (framework_logger_pt) apr_palloc(pool, sizeof(*logger));
+ logger = (framework_logger_pt) malloc(sizeof(*logger));
logger->logFunction = frameworkLogger_log;
}
void teardown() {
- apr_pool_destroy(pool);
mock().checkExpectations();
mock().clear();
}
@@ -64,27 +58,19 @@ TEST(bundle_context, create) {
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- mock().expectOneCall("bundle_getMemoryPool")
- .withParameter("bundle", bundle)
- .andOutputParameter("pool", pool)
- .andReturnValue(CELIX_SUCCESS);
-
bundle_context_pt context = NULL;
- bundleContext_create(pool, framework, logger, bundle, &context);
+ bundleContext_create(NULL, framework, logger, bundle, &context);
POINTERS_EQUAL(framework, context->framework)
POINTERS_EQUAL(bundle, context->bundle)
- CHECK(context->pool);
+// CHECK(context->pool);
}
TEST(bundle_context, destroy) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- apr_pool_t *spool = NULL;
- apr_pool_create(&spool, pool);
context->framework = framework;
context->bundle = bundle;
- context->pool = spool;
celix_status_t status = bundleContext_destroy(context);
LONGS_EQUAL(CELIX_SUCCESS, status);
@@ -94,7 +80,7 @@ TEST(bundle_context, destroy) {
}
TEST(bundle_context, getBundle) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
apr_pool_t *pool = (apr_pool_t *) 0x30;
@@ -132,7 +118,7 @@ TEST(bundle_context, getBundle) {
}
TEST(bundle_context, installBundle) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
apr_pool_t *pool = (apr_pool_t *) 0x30;
@@ -146,7 +132,7 @@ TEST(bundle_context, installBundle) {
.withParameter("framework", framework)
.withParameter("location", location)
.withParameter("inputFile", (char *) NULL)
- .andOutputParameter("bundle", installedBundle)
+ .withOutputParameterReturning("bundle", &installedBundle, sizeof(installedBundle))
.andReturnValue(CELIX_SUCCESS);
bundle_pt actualInstalledBundle = NULL;
@@ -156,13 +142,11 @@ TEST(bundle_context, installBundle) {
}
TEST(bundle_context, installBundle2) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- apr_pool_t *pool = (apr_pool_t *) 0x30;
context->framework = framework;
context->bundle = bundle;
- context->pool = pool;
char location[] = "test.zip";
char inputFile[] = "input.zip";
@@ -171,7 +155,7 @@ TEST(bundle_context, installBundle2) {
.withParameter("framework", framework)
.withParameter("location", location)
.withParameter("inputFile", inputFile)
- .andOutputParameter("bundle", installedBundle)
+ .withOutputParameterReturning("bundle", &installedBundle, sizeof(installedBundle))
.andReturnValue(CELIX_SUCCESS);
bundle_pt actualInstalledBundle = NULL;
@@ -185,13 +169,11 @@ TEST(bundle_context, installBundle2) {
}
TEST(bundle_context, registerService) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- apr_pool_t *pool = (apr_pool_t *) 0x30;
context->framework = framework;
context->bundle = bundle;
- context->pool = pool;
char serviceName[] = "service";
void *service = (void *) 0x40;
@@ -204,7 +186,7 @@ TEST(bundle_context, registerService) {
.withParameter("serviceName", serviceName)
.withParameter("service", service)
.withParameter("properties", properties)
- .andOutputParameter("registration", registration)
+ .withOutputParameterReturning("registration", ®istration, sizeof(registration))
.andReturnValue(CELIX_SUCCESS);
service_registration_pt actualRegistration = NULL;
@@ -218,13 +200,11 @@ TEST(bundle_context, registerService) {
}
TEST(bundle_context, registerServiceFactory) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- apr_pool_t *pool = (apr_pool_t *) 0x30;
context->framework = framework;
context->bundle = bundle;
- context->pool = pool;
char serviceName[] = "service";
service_factory_pt serviceFactory = (service_factory_pt) 0x40;
@@ -237,7 +217,7 @@ TEST(bundle_context, registerServiceFact
.withParameter("serviceName", serviceName)
.withParameter("serviceFactory", serviceFactory)
.withParameter("properties", properties)
- .andOutputParameter("registration", registration)
+ .withOutputParameterReturning("registration", ®istration, sizeof(registration))
.andReturnValue(CELIX_SUCCESS);
service_registration_pt actualRegistration = NULL;
@@ -251,13 +231,11 @@ TEST(bundle_context, registerServiceFact
}
TEST(bundle_context, getServiceReferences) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
- apr_pool_t *pool = (apr_pool_t *) 0x30;
context->framework = framework;
context->bundle = bundle;
- context->pool = pool;
char serviceName[] = "service";
char filter[] = "";
@@ -268,7 +246,7 @@ TEST(bundle_context, getServiceReference
.withParameter("bundle", bundle)
.withParameter("serviceName", serviceName)
.withParameter("filter", filter)
- .andOutputParameter("references", references)
+ .withOutputParameterReturning("references", &references, sizeof(references))
.andReturnValue(CELIX_SUCCESS);
array_list_pt actualReferences = NULL;
@@ -282,7 +260,7 @@ TEST(bundle_context, getServiceReference
}
TEST(bundle_context, getServiceReference) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -299,7 +277,7 @@ TEST(bundle_context, getServiceReference
.withParameter("bundle", bundle)
.withParameter("serviceName", serviceName)
.withParameter("filter", (char *) NULL)
- .andOutputParameter("references", references)
+ .withOutputParameterReturning("references", &references, sizeof(references))
.andReturnValue(CELIX_SUCCESS);
service_reference_pt actualReference = NULL;
@@ -313,7 +291,7 @@ TEST(bundle_context, getServiceReference
}
TEST(bundle_context, getService) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -327,7 +305,7 @@ TEST(bundle_context, getService) {
.withParameter("framework", framework)
.withParameter("bundle", bundle)
.withParameter("reference", serviceReference)
- .andOutputParameter("service", service)
+ .withOutputParameterReturning("service", &service, sizeof(service))
.andReturnValue(CELIX_SUCCESS);
void *actualService = NULL;
@@ -341,7 +319,7 @@ TEST(bundle_context, getService) {
}
TEST(bundle_context, ungetService) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -355,7 +333,7 @@ TEST(bundle_context, ungetService) {
.withParameter("framework", framework)
.withParameter("bundle", bundle)
.withParameter("reference", serviceReference)
- .andOutputParameter("result", result)
+ .withOutputParameterReturning("result", &result, sizeof(result))
.andReturnValue(CELIX_SUCCESS);
bool actualResult = false;
@@ -369,7 +347,7 @@ TEST(bundle_context, ungetService) {
}
TEST(bundle_context, getBundles) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -392,7 +370,7 @@ TEST(bundle_context, getBundles) {
}
TEST(bundle_context, getBundleById) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -417,7 +395,7 @@ TEST(bundle_context, getBundleById) {
}
TEST(bundle_context, addServiceListener) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -442,7 +420,7 @@ TEST(bundle_context, addServiceListener)
}
TEST(bundle_context, removeServiceListener) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -465,7 +443,7 @@ TEST(bundle_context, removeServiceListen
}
TEST(bundle_context, addBundleListener) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -488,7 +466,7 @@ TEST(bundle_context, addBundleListener)
}
TEST(bundle_context, removeBundleListener) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
@@ -511,18 +489,18 @@ TEST(bundle_context, removeBundleListene
}
TEST(bundle_context, getProperty) {
- bundle_context_pt context = (bundle_context_pt) apr_palloc(pool, sizeof(*context));
+ bundle_context_pt context = (bundle_context_pt) malloc(sizeof(*context));
framework_pt framework = (framework_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
context->framework = framework;
context->bundle = bundle;
- char name[] = "property";
- char value[] = "value";
+ char *name = (char *) "property";
+ char *value = (char *) "value";
mock().expectOneCall("fw_getProperty")
.withParameter("framework", framework)
.withParameter("name", name)
- .withParameter("value", value)
+ .withOutputParameterReturning("value", &value, sizeof(value))
.andReturnValue(CELIX_SUCCESS);
char *actualValue = NULL;
Modified: celix/trunk/framework/private/test/bundle_revision_test.cpp
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/test/bundle_revision_test.cpp?rev=1618476&r1=1618475&r2=1618476&view=diff
==============================================================================
--- celix/trunk/framework/private/test/bundle_revision_test.cpp (original)
+++ celix/trunk/framework/private/test/bundle_revision_test.cpp Sun Aug 17 14:45:28 2014
@@ -67,7 +67,7 @@ TEST(bundle_revision, create) {
.andReturnValue(CELIX_SUCCESS);
mock().expectOneCall("manifest_createFromFile")
.withParameter("filename", "bundle_revision_test/META-INF/MANIFEST.MF")
- .andOutputParameter("manifest", manifest)
+ .withOutputParameterReturning("manifest", &manifest, sizeof(manifest))
.andReturnValue(CELIX_SUCCESS);
bundle_revision_pt revision = NULL;
@@ -92,7 +92,7 @@ TEST(bundle_revision, createWithInput) {
mock().expectOneCall("manifest_createFromFile")
.withParameter("filename", "bundle_revision_test/META-INF/MANIFEST.MF")
- .andOutputParameter("manifest", manifest)
+ .withOutputParameterReturning("manifest", &manifest, sizeof(manifest))
.andReturnValue(CELIX_SUCCESS);
bundle_revision_pt revision = NULL;