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/10/26 12:16:10 UTC
[47/50] [abbrv] celix git commit: CELIX-282: Updates expected mock
calls for updated logging info.
CELIX-282: Updates expected mock calls for updated logging info.
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6959571e
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6959571e
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6959571e
Branch: refs/heads/master
Commit: 6959571eb745e666f60b551b68d2806b9e885602
Parents: 147a307
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Mon Oct 17 00:16:28 2016 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Mon Oct 17 00:16:28 2016 +0200
----------------------------------------------------------------------
.../private/test/service_registry_test.cpp | 21 +++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/6959571e/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 35725e0..95017ae 100644
--- a/framework/private/test/service_registry_test.cpp
+++ b/framework/private/test/service_registry_test.cpp
@@ -647,6 +647,7 @@ TEST(service_registry, ungetServiceReference){
service_reference_pt reference3 = (service_reference_pt) 0x60;
bundle_pt bundle = (bundle_pt) 0x70;
bundle_pt bundle2 = (bundle_pt) 0x80;
+ module_pt module = (module_pt) 0x90;
hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
hashMap_put(references, registration, reference);
@@ -692,13 +693,31 @@ TEST(service_registry, ungetServiceReference){
destroyed = true;
count = 5;
+ const char* mod_name = "mod name";
+ const char* srv_name = "srv name";
mock().expectOneCall("serviceReference_getUsageCount")
.withParameter("reference", reference)
.withOutputParameterReturning("count", &count, sizeof(count));
mock().expectOneCall("serviceReference_release")
.withParameter("ref", reference)
.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
- mock().expectOneCall("framework_log");
+ mock().expectNCalls(2, "bundle_getCurrentModule")
+ .withParameter("bundle", bundle)
+ .withOutputParameterReturning("module", &module, sizeof(module));
+ mock().expectNCalls(2, "module_getSymbolicName")
+ .withParameter("module", module)
+ .withOutputParameterReturning("symbolicName", &mod_name, sizeof(mod_name));
+ mock().expectOneCall("serviceReference_getProperty")
+ .withParameter("reference", reference)
+ .withParameter("key", OSGI_FRAMEWORK_OBJECTCLASS)
+ .withOutputParameterReturning("value", &srv_name, sizeof(srv_name));
+ mock().expectOneCall("serviceReference_getServiceRegistration")
+ .withParameter("reference", reference)
+ .withOutputParameterReturning("registration", ®istration, sizeof(registration));
+ mock().expectOneCall("serviceRegistration_getBundle")
+ .withParameter("registration", registration)
+ .withOutputParameterReturning("bundle", &bundle, sizeof(bundle));
+ mock().expectNCalls(2, "framework_log");
serviceRegistry_ungetServiceReference(registry, bundle, reference);