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 2019/05/02 21:42:14 UTC

[celix] branch develop updated: CELIX-461: Some refactoring for in the usage of the celix_ api.

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/develop by this push:
     new 339e64d  CELIX-461: Some refactoring for in the usage of the celix_ api.
     new 9f14dcf  Merge branch 'develop' of github.com:apache/celix into develop
339e64d is described below

commit 339e64d5b91f3731d04a1377558ca6f74c2182ae
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Thu May 2 23:40:50 2019 +0200

    CELIX-461: Some refactoring for in the usage of the celix_ api.
---
 libs/framework/include/celix/dm/Component_Impl.h   |  4 +-
 libs/framework/include/celix/dm/DmActivator.h      |  2 +-
 libs/framework/include/celix_api.h                 |  1 +
 libs/framework/include/celix_bundle_context.h      | 96 +++++++++++++---------
 libs/framework/include/celix_framework_factory.h   |  8 +-
 libs/framework/src/celix_framework_factory.c       | 10 ++-
 .../framework/tst/bundle_context_bundles_tests.cpp | 11 ++-
 .../framework/tst/bundle_context_services_test.cpp | 20 ++---
 libs/framework/tst/single_framework_test.cpp       | 10 +--
 9 files changed, 95 insertions(+), 67 deletions(-)

diff --git a/libs/framework/include/celix/dm/Component_Impl.h b/libs/framework/include/celix/dm/Component_Impl.h
index a7e74c5..914c546 100644
--- a/libs/framework/include/celix/dm/Component_Impl.h
+++ b/libs/framework/include/celix/dm/Component_Impl.h
@@ -77,7 +77,7 @@ Component<T>& Component<T>::addInterface(const std::string version, const Proper
 template<class T>
 template<class I>
 Component<T>& Component<T>::addCInterface(const I* svc, const std::string serviceName, const std::string version, const Properties properties) {
-    static_assert(std::is_pod<I>::value, "Service I must be a 'Plain Old Data' object");
+    static_assert(std::is_standard_layout<I>::value, "Service I must be an object with a standard layout");
     celix_properties_t *cProperties = properties_create();
     properties_set(cProperties, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
     for (const auto& pair : properties) {
@@ -93,7 +93,7 @@ Component<T>& Component<T>::addCInterface(const I* svc, const std::string servic
 template<class T>
 template<class I>
 Component<T>& Component<T>::removeCInterface(const I* svc){
-    static_assert(std::is_pod<I>::value, "Service I must be a 'Plain Old Data' object");
+    static_assert(std::is_standard_layout<I>::value, "Service I must be an object with a standard layout");
     celix_dmComponent_removeInterface(this->cComponent(), svc);
     return *this;
 };
diff --git a/libs/framework/include/celix/dm/DmActivator.h b/libs/framework/include/celix/dm/DmActivator.h
index 9370695..55a7573 100644
--- a/libs/framework/include/celix/dm/DmActivator.h
+++ b/libs/framework/include/celix/dm/DmActivator.h
@@ -28,7 +28,7 @@
 
 namespace celix { namespace dm {
 
-    class __attribute__((deprecated)) DmActivator {
+    class DmActivator {
     public:
         DmActivator(DependencyManager& m) : mng(m), ctx{m.bundleContext()}  {}
         virtual ~DmActivator() = default;
diff --git a/libs/framework/include/celix_api.h b/libs/framework/include/celix_api.h
index 1b5d31d..0b8409f 100644
--- a/libs/framework/include/celix_api.h
+++ b/libs/framework/include/celix_api.h
@@ -43,6 +43,7 @@
 #include "dm_service_dependency.h"
 
 #include "celix_bundle_activator.h"
+#include "celix_framework_factory.h"
 
 #ifdef __cplusplus
 #include "celix/dm/DependencyManager.h"
diff --git a/libs/framework/include/celix_bundle_context.h b/libs/framework/include/celix_bundle_context.h
index 44b6f3c..18fdb57 100644
--- a/libs/framework/include/celix_bundle_context.h
+++ b/libs/framework/include/celix_bundle_context.h
@@ -26,11 +26,21 @@
 #ifndef CELIX_BUNDLE_CONTEXT_H_
 #define CELIX_BUNDLE_CONTEXT_H_
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /**
+ * Init macro so that the opts are correctly initialized for C++ compilers
+ */
+#ifdef __cplusplus
+#define OPTS_INIT {}
+#else
+#define OPTS_INIT
+#endif
+
+/**
 * Register a service to the Celix framework.
 *
 * @param ctx The bundle context
@@ -70,7 +80,7 @@ typedef struct celix_service_registration_options {
      *
      * The bundle is responsible to keep the service pointer valid as long as it is registered in the Celix framework.
      */
-    void *svc;
+    void *svc OPTS_INIT;
 
     /**
      * The service factory pointer.
@@ -86,13 +96,13 @@ typedef struct celix_service_registration_options {
      *
      * The bundle is responsible to keep the service factory pointer valid as long as it is registered in the Celix framework.
      */
-    celix_service_factory_t *factory;
+    celix_service_factory_t *factory OPTS_INIT;
 
     /**
      * The required service name. This is used to identify the service. A fully qualified name with a namespace is
      * advisable to prevent name collision. (e.g. EXAMPLE_PRESSURE_SENSOR).
      */
-    const char *serviceName;
+    const char *serviceName OPTS_INIT;
 
     /**
      * The optional service properties. These contain meta information about the service in the
@@ -101,12 +111,12 @@ typedef struct celix_service_registration_options {
      * When a service is registered the Celix framework will take ownership of the provided properties.
      * If a registration fails, the properties will be destroyed (freed) by the Celix framework.
      */
-    celix_properties_t *properties;
+    celix_properties_t *properties OPTS_INIT;
 
     /**
      * The optional service language. If this is NULL, CELIX_FRAMEWORK_SERVICE_LANGUAGE_C is used.
      */
-    const char *serviceLanguage;
+    const char *serviceLanguage OPTS_INIT;
 
     /**
      * The optional service version (in the form of <MAJOR>.<MINOR>.<MICRO>.<QUALIFIER>).
@@ -115,18 +125,20 @@ typedef struct celix_service_registration_options {
      * service in those version range are compatible (binary of source). It is advisable to use semantic versioning
      * for this.
      */
-    const char *serviceVersion;
+    const char *serviceVersion OPTS_INIT;
 } celix_service_registration_options_t;
 
 /**
- * Macro to create a empty celix_service_registration_options_t type.
+ * C Macro to create a empty celix_service_registration_options_t type.
  */
+#ifndef __cplusplus
 #define CELIX_EMPTY_SERVICE_REGISTRATION_OPTIONS { .svc = NULL, \
     .factory = NULL, \
     .serviceName = NULL, \
     .properties = NULL, \
     .serviceLanguage = NULL, \
     .serviceVersion = NULL }
+#endif
 
 
 /**
@@ -182,38 +194,40 @@ typedef struct celix_service_filter_options {
     /**
      * The required service name.
      */
-    const char* serviceName;
+    const char* serviceName OPTS_INIT;
 
     /**
      * The optional version range. If service are registered with a service version this attribute can be used to
      * only select service with a version in the version range.
      * It uses the maven version range format, e.g. [1.0.0,2.0.0) or [1.1.1], etc.
      */
-    const char* versionRange;
+    const char* versionRange OPTS_INIT;
 
     /**
      * LDAP filter to use for fine tuning the filtering, e.g. (|(location=middle)(location=front))
      * The filter will be applied to all the user provided and framework provided service properties.
      */
-    const char* filter;
+    const char* filter OPTS_INIT;
 
     /**
      * The optional service language to filter for. If this is NULL or "" the C language will be used.
      */
-    const char* serviceLanguage;
+    const char* serviceLanguage OPTS_INIT;
 
 
     /**
      * Whether to ignore (not filter for) the service.lang property.
      * If this is set the serviceLanguage field is ignored and the (service.lang=<>) part is not added tot he filter
      */
-    bool ignoreServiceLanguage;
+    bool ignoreServiceLanguage OPTS_INIT;
 } celix_service_filter_options_t;
 
 /**
- * Macro to create a empty celix_service_filter_options_t type.
+ * C Macro to create a empty celix_service_filter_options_t type.
  */
+#ifndef __cplusplus
 #define CELIX_EMPTY_SERVICE_FILTER_OPTIONS {.serviceName = NULL, .versionRange = NULL, .filter = NULL, .serviceLanguage = NULL, .ignoreServiceLanguage = false}
+#endif
 
 
 /**
@@ -279,12 +293,12 @@ typedef struct celix_service_tracking_options {
     /**
      * The service filter options, used to setup the filter for the service to track.
      */
-    celix_service_filter_options_t filter;
+    celix_service_filter_options_t filter OPTS_INIT;
 
     /**
      * The optional callback pointer used in all the provided callback function (set, add, remove, setWithProperties, etc).
      */
-    void* callbackHandle;
+    void* callbackHandle OPTS_INIT;
 
     /**
      * The optional set callback will be called when a new highest ranking service is available conform the provided
@@ -292,19 +306,19 @@ typedef struct celix_service_tracking_options {
      * @param handle The callbackHandle pointer as provided in the service tracker options.
      * @param svc The service pointer of the highest ranking service.
      */
-    void (*set)(void *handle, void *svc);
+    void (*set)(void *handle, void *svc) OPTS_INIT;
 
     /**
      * The optional setWithProperties callback is handled as the set callback, but with the addition that the service properties
      * will also be provided to the callback.
      */
-    void (*setWithProperties)(void *handle, void *svc, const celix_properties_t *props); //highest ranking
+    void (*setWithProperties)(void *handle, void *svc, const celix_properties_t *props) OPTS_INIT; //highest ranking
 
     /**
      * The optional setWithOwner callback is handled as the set callback, but with the addition that the service properties
      * and the bundle owning the service will also be provided to the callback.
      */
-    void (*setWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner); //highest ranking
+    void (*setWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) OPTS_INIT; //highest ranking
 
     /**
      * The optional add callback will be called for every current and future service found conform the provided service filter
@@ -312,19 +326,19 @@ typedef struct celix_service_tracking_options {
      * @param handle The callbackHandle pointer as provided in the service tracker options.
      * @param svc The service pointer of a service matching the provided service filter options.
      */
-    void (*add)(void *handle, void *svc);
+    void (*add)(void *handle, void *svc) OPTS_INIT;
 
     /**
      * The optional addWithProperties callback is handled as the add callback, but with the addition that the service properties
      * will also be provided to the callback.
      */
-    void (*addWithProperties)(void *handle, void *svc, const celix_properties_t *props);
+    void (*addWithProperties)(void *handle, void *svc, const celix_properties_t *props) OPTS_INIT;
 
     /**
      * The optional addWithOwner callback is handled as the add callback, but with the addition that the service properties
      * and the bundle owning the service will also be provided to the callback.
      */
-    void (*addWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner);
+    void (*addWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) OPTS_INIT;
 
     /**
      * The optional remove callback will be called for every service conform the provided service filter options that is
@@ -335,24 +349,25 @@ typedef struct celix_service_tracking_options {
      * @param handle The callbackHandle pointer as provided in the service tracker options.
      * @param svc The service pointer of a service matching the provided service filter options.
      */
-    void (*remove)(void *handle, void *svc);
+    void (*remove)(void *handle, void *svc) OPTS_INIT;
 
     /**
      * The optional removeWithProperties callback is handled as the remove callback, but with the addition that the service properties
      * will also be provided to the callback.
      */
-    void (*removeWithProperties)(void *handle, void *svc, const celix_properties_t *props);
+    void (*removeWithProperties)(void *handle, void *svc, const celix_properties_t *props) OPTS_INIT;
 
     /**
     * The optional removeWithOwner callback is handled as the remove callback, but with the addition that the service properties
     * and the bundle owning the service will also be provided to the callback.
     */
-    void (*removeWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner);
+    void (*removeWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) OPTS_INIT;
 } celix_service_tracking_options_t;
 
 /**
- * Macro to create a empty celix_service_tracking_options_t type.
+ * C Macro to create a empty celix_service_tracking_options_t type.
  */
+#ifndef __cplusplus
 #define CELIX_EMPTY_SERVICE_TRACKING_OPTIONS { .filter.serviceName = NULL, \
     .filter.versionRange = NULL, \
     .filter.filter = NULL, \
@@ -368,6 +383,7 @@ typedef struct celix_service_tracking_options {
     .setWithOwner = NULL, \
     .addWithOwner = NULL, \
     .removeWithOwner = NULL}
+#endif
 
 /**
  * Tracks services using the provided tracker options.
@@ -470,12 +486,12 @@ typedef struct celix_service_use_options {
     /**
      * The service filter options, used to setup the filter for the service to track.
      */
-    celix_service_filter_options_t filter;
+    celix_service_filter_options_t filter OPTS_INIT;
 
     /**
      * The optional callback pointer used in all the provided callback function (set, add, remove, setWithProperties, etc).
      */
-    void *callbackHandle;
+    void *callbackHandle OPTS_INIT;
 
     /**
      * The optional use callback will be called when for every services found conform the service filter options
@@ -484,24 +500,25 @@ typedef struct celix_service_use_options {
      * @param handle The callbackHandle pointer as provided in the service tracker options.
      * @param svc The service pointer of the highest ranking service.
      */
-    void (*use)(void *handle, void *svc);
+    void (*use)(void *handle, void *svc) OPTS_INIT;
 
     /**
      * The optional useWithProperties callback is handled as the use callback, but with the addition that the service properties
      * will also be provided to the callback.
      */
-    void (*useWithProperties)(void *handle, void *svc, const celix_properties_t *props);
+    void (*useWithProperties)(void *handle, void *svc, const celix_properties_t *props) OPTS_INIT;
 
     /**
      * The optional useWithOwner callback is handled as the yse callback, but with the addition that the service properties
      * and the bundle owning the service will also be provided to the callback.
      */
-    void (*useWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner);
+    void (*useWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) OPTS_INIT;
 } celix_service_use_options_t;
 
 /**
- * Macro to create a empty celix_service_use_options_t type.
+ * C Macro to create a empty celix_service_use_options_t type.
  */
+#ifndef __cplusplus
 #define CELIX_EMPTY_SERVICE_USE_OPTIONS {.filter.serviceName = NULL, \
     .filter.versionRange = NULL, \
     .filter.filter = NULL, \
@@ -510,6 +527,7 @@ typedef struct celix_service_use_options {
     .use = NULL, \
     .useWithProperties = NULL, \
     .useWithOwner = NULL}
+#endif
 
 /**
  * Use the services with the provided service filter options using the provided callback. The Celix framework will
@@ -626,7 +644,7 @@ typedef struct celix_bundle_tracker_options {
     /**
      * The optional callback pointer used in all the provided callback function (set, add, remove, setWithProperties, etc).
      */
-    void* callbackHandle;
+    void* callbackHandle OPTS_INIT;
 
     /**
      * Tracker callback when a bundle is installed.
@@ -634,7 +652,7 @@ typedef struct celix_bundle_tracker_options {
      * @param bundle    The bundle which has been started.
      *                  The bundle pointer is only guaranteed to be valid during the callback.
      */
-    void (*onStarted)(void *handle, const celix_bundle_t *bundle); //highest ranking
+    void (*onStarted)(void *handle, const celix_bundle_t *bundle) OPTS_INIT; //highest ranking
 
     /**
      * Tracker callback when a bundle is removed.
@@ -642,7 +660,7 @@ typedef struct celix_bundle_tracker_options {
      * @param bundle    The bundle which has been started.
      *                  The bundle pointer is only guaranteed to be valid during the callback.
      */
-    void (*onStopped)(void *handle, const celix_bundle_t *bundle);
+    void (*onStopped)(void *handle, const celix_bundle_t *bundle) OPTS_INIT;
 
     //TODO callback for on installed, resolved, uninstalled ??
 
@@ -651,19 +669,21 @@ typedef struct celix_bundle_tracker_options {
      * @param handle    The handle, contains the value of the callbackHandle.
      * @param event     The bundle event. Is only valid during the callback.
      */
-    void (*onBundleEvent)(void *handle, const celix_bundle_event_t *event);
+    void (*onBundleEvent)(void *handle, const celix_bundle_event_t *event) OPTS_INIT;
 
     /**
      * Default the framework bundle (bundle id 0) will not trigger the callbacks.
      * This is done, because the framework bundle is a special bundle which is generally not needed in the callbacks.
      */
-    bool includeFrameworkBundle;
+    bool includeFrameworkBundle OPTS_INIT;
 } celix_bundle_tracking_options_t;
 
 /**
- * Macro to create a empty celix_service_filter_options_t type.
+ * C Macro to create a empty celix_service_filter_options_t type.
  */
+#ifndef __cplusplus
 #define CELIX_EMPTY_BUNDLE_TRACKING_OPTIONS {.callbackHandle = NULL, .onStarted = NULL, .onStopped = NULL, .onBundleEvent = NULL}
+#endif
 
 /**
  * Tracks bundles using the provided bundle tracker options.
@@ -819,6 +839,8 @@ bool celix_bundleContext_getPropertyAsBool(celix_bundle_context_t *ctx, const ch
 
 //TODO getPropertyAs for int, uint, ulong, bool, etc
 
+#undef OPTS_INIT
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/libs/framework/include/celix_framework_factory.h b/libs/framework/include/celix_framework_factory.h
index 74e7c06..c5dc44c 100644
--- a/libs/framework/include/celix_framework_factory.h
+++ b/libs/framework/include/celix_framework_factory.h
@@ -31,7 +31,13 @@ extern "C" {
  * @param config The framework configuration. Can be NULL.
  * @return a started framework or NULL
  */
-celix_framework_t* frameworkFactory_newFramework(celix_properties_t *config);
+celix_framework_t* celix_frameworkFactory_createFramework(celix_properties_t *config);
+
+/**
+ * Stop and destroys a Celix framework
+ * Note that this call block till the Celix framework is stopped
+ */
+void celix_frameworkFactory_destroyFramework(celix_framework_t *fw);
 
 
 #ifdef __cplusplus
diff --git a/libs/framework/src/celix_framework_factory.c b/libs/framework/src/celix_framework_factory.c
index d5faf78..95a0035 100644
--- a/libs/framework/src/celix_framework_factory.c
+++ b/libs/framework/src/celix_framework_factory.c
@@ -19,7 +19,7 @@
 
 #include "celix_framework_factory.h"
 
-framework_t* frameworkFactory_newFramework(properties_t *config) {
+framework_t* celix_frameworkFactory_createFramework(properties_t *config) {
     framework_t* fw = NULL;
 
     if (config == NULL) {
@@ -38,3 +38,11 @@ framework_t* frameworkFactory_newFramework(properties_t *config) {
     }
     return fw;
 }
+
+void celix_frameworkFactory_destroyFramework(celix_framework_t *fw) {
+    if (fw != NULL) {
+        framework_stop(fw);
+        framework_waitForStop(fw);
+        framework_destroy(fw);
+    }
+}
diff --git a/libs/framework/tst/bundle_context_bundles_tests.cpp b/libs/framework/tst/bundle_context_bundles_tests.cpp
index 179bb6f..332e8e5 100644
--- a/libs/framework/tst/bundle_context_bundles_tests.cpp
+++ b/libs/framework/tst/bundle_context_bundles_tests.cpp
@@ -22,12 +22,13 @@
 #include <mutex>
 #include <condition_variable>
 
-#include <CppUTest/TestHarness.h>
-#include <CppUTest/CommandLineTestRunner.h>
 #include <zconf.h>
 
 #include "celix_api.h"
 
+#include <CppUTest/TestHarness.h>
+#include <CppUTest/CommandLineTestRunner.h>
+
 
 TEST_GROUP(CelixBundleContextBundlesTests) {
     framework_t* fw = NULL;
@@ -46,14 +47,12 @@ TEST_GROUP(CelixBundleContextBundlesTests) {
         properties_set(properties, "org.osgi.framework.storage.clean", "onFirstInit");
         properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework");
 
-        fw = frameworkFactory_newFramework(properties);
+        fw = celix_frameworkFactory_createFramework(properties);
         ctx = framework_getContext(fw);
     }
 
     void teardown() {
-        framework_stop(fw);
-        framework_waitForStop(fw);
-        framework_destroy(fw);
+        celix_frameworkFactory_destroyFramework(fw);
     }
 };
 
diff --git a/libs/framework/tst/bundle_context_services_test.cpp b/libs/framework/tst/bundle_context_services_test.cpp
index 0e929a2..b276dfe 100644
--- a/libs/framework/tst/bundle_context_services_test.cpp
+++ b/libs/framework/tst/bundle_context_services_test.cpp
@@ -47,14 +47,12 @@ TEST_GROUP(CelixBundleContextServicesTests) {
         properties_set(properties, "org.osgi.framework.storage.clean", "onFirstInit");
         properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework");
 
-        fw = frameworkFactory_newFramework(properties);
+        fw = celix_frameworkFactory_createFramework(properties);
         ctx = framework_getContext(fw);
     }
 
     void teardown() {
-        framework_stop(fw);
-        framework_waitForStop(fw);
-        framework_destroy(fw);
+        celix_frameworkFactory_destroyFramework(fw);
     }
 };
 
@@ -294,8 +292,7 @@ TEST(CelixBundleContextServicesTests, servicesTrackerInvalidArgsTest) {
     CHECK(trackerId < 0); //required ctx and opts missing
     trackerId = celix_bundleContext_trackServicesWithOptions(ctx, NULL);
     CHECK(trackerId < 0); //required opts missing
-    celix_service_tracking_options_t opts;
-    memset(&opts, 0, sizeof(opts));
+    celix_service_tracking_options_t opts{};
     trackerId = celix_bundleContext_trackServicesWithOptions(ctx, &opts);
     CHECK(trackerId < 0); //required opts->serviceName missing
     opts.filter.serviceName = "calc";
@@ -360,8 +357,7 @@ TEST(CelixBundleContextServicesTests, servicesTrackerTestWithProperties) {
 
     long svcId1 = celix_bundleContext_registerService(ctx, (void*)0x100, "calc", NULL);
 
-    celix_service_tracking_options_t opts;
-    memset(&opts, 0, sizeof(opts));
+    celix_service_tracking_options_t opts{};
     opts.filter.serviceName = "calc";
     opts.callbackHandle = &count;
     opts.addWithProperties = add;
@@ -400,8 +396,7 @@ TEST(CelixBundleContextServicesTests, servicesTrackerTestWithOwner) {
 
     long svcId1 = celix_bundleContext_registerService(ctx, (void*)0x100, "calc", NULL);
 
-    celix_service_tracking_options_t opts;
-    memset(&opts, 0, sizeof(opts));
+    celix_service_tracking_options_t opts{};
     opts.filter.serviceName = "calc";
     opts.callbackHandle = &count;
     opts.addWithOwner = add;
@@ -555,8 +550,7 @@ TEST(CelixBundleContextServicesTests, servicesTrackerSetTest) {
     long svcId2 = celix_bundleContext_registerService(ctx, svc2, "NA", NULL);
 
     //starting tracker should lead to first set call
-    celix_service_tracking_options_t opts;
-    memset(&opts, 0, sizeof(opts));
+    celix_service_tracking_options_t opts{};
     opts.callbackHandle = (void*)&count;
     opts.filter.serviceName = "NA";
     opts.set = set;
@@ -647,7 +641,7 @@ TEST(CelixBundleContextServicesTests, findServicesTest) {
 
     celix_bundleContext_unregisterService(ctx, svcId1);
 
-    celix_service_filter_options_t opts = CELIX_EMPTY_SERVICE_FILTER_OPTIONS;
+    celix_service_filter_options_t opts{};
     opts.serviceName = "example";
     foundId = celix_bundleContext_findServiceWithOptions(ctx, &opts);
     CHECK_EQUAL(foundId, svcId2); //only one left
diff --git a/libs/framework/tst/single_framework_test.cpp b/libs/framework/tst/single_framework_test.cpp
index 307eb1b..861f186 100644
--- a/libs/framework/tst/single_framework_test.cpp
+++ b/libs/framework/tst/single_framework_test.cpp
@@ -87,15 +87,13 @@ TEST_GROUP(FrameworkFactory) {
 
 
 TEST(FrameworkFactory, testFactoryCreate) {
-    framework_t* fw = frameworkFactory_newFramework(NULL);
+    framework_t* fw = celix_frameworkFactory_createFramework(NULL);
     CHECK(fw != NULL);
-    framework_stop(fw);
-    framework_waitForStop(fw);
-    framework_destroy(fw); //note stop, wait and then destroy is needed .. combine ?
+    celix_frameworkFactory_destroyFramework(fw);
 }
 
 TEST(FrameworkFactory, testFactoryCreateAndToManyStartAndStops) {
-    framework_t* fw = frameworkFactory_newFramework(NULL);
+    framework_t* fw = celix_frameworkFactory_createFramework(NULL);
     CHECK(fw != NULL);
 
     framework_start(fw); //should already be done by frameworkFactory_newFramework();
@@ -114,7 +112,7 @@ TEST(FrameworkFactory, testFactoryCreateAndToManyStartAndStops) {
 }
 
 TEST(FrameworkFactory, restartFramework) {
-    framework_t* fw = frameworkFactory_newFramework(NULL);
+    framework_t* fw = celix_frameworkFactory_createFramework(NULL);
     CHECK(fw != NULL);