You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2016/08/04 19:46:23 UTC
[2/2] celix git commit: CELIX-372: Fixes service_registry test. Adds
module_mock to sources and setup for module mock calls.
CELIX-372: Fixes service_registry test. Adds module_mock to sources and setup for module mock calls.
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/97cc9249
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/97cc9249
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/97cc9249
Branch: refs/heads/develop
Commit: 97cc92490148490c5d8fca9a8c07e3530d466ef4
Parents: b5e0585
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Aug 4 21:45:07 2016 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Aug 4 21:45:07 2016 +0200
----------------------------------------------------------------------
framework/CMakeLists.txt | 1 +
framework/private/test/service_registry_test.cpp | 9 +++++++++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/97cc9249/framework/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index c08b27c..06eead2 100644
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -304,6 +304,7 @@ if (FRAMEWORK)
private/mock/service_registration_mock.c
private/mock/properties_mock.c
private/src/service_registry.c
+ private/mock/module_mock.c
private/src/celix_errorcodes.c
private/mock/celix_log_mock.c)
target_link_libraries(service_registry_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
http://git-wip-us.apache.org/repos/asf/celix/blob/97cc9249/framework/private/test/service_registry_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_registry_test.cpp b/framework/private/test/service_registry_test.cpp
index 5a0e9f0..8bf8b0a 100644
--- a/framework/private/test/service_registry_test.cpp
+++ b/framework/private/test/service_registry_test.cpp
@@ -727,6 +727,8 @@ TEST(service_registry, clearReferencesFor){
service_reference_pt reference = (service_reference_pt) 0x40;
service_reference_pt reference2 = (service_reference_pt) 0x50;
bundle_pt bundle = (bundle_pt) 0x70;
+ module_pt module = (module_pt) 0x80;
+ const char* modName = "mod name";
hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
hashMap_put(references, registration, reference);
@@ -767,6 +769,13 @@ TEST(service_registry, clearReferencesFor){
mock().expectOneCall("serviceReference_release")
.withParameter("ref", reference2)
.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
+ mock().expectOneCall("bundle_getCurrentModule")
+ .withParameter("bundle", bundle)
+ .withOutputParameterReturning("module", &module, sizeof(module));
+ mock().expectOneCall("module_getSymbolicName")
+ .withParameter("module", module)
+ .withOutputParameterReturning("symbolicName", &modName, sizeof(modName));
+ mock().expectOneCall("framework_log");
serviceRegistry_clearReferencesFor(registry, bundle);