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 2015/11/17 14:16:20 UTC
celix git commit: CELIX-295: Apply path wich removes alot of compiler
warnings
Repository: celix
Updated Branches:
refs/heads/develop 00284f5d2 -> 367608211
CELIX-295: Apply path wich removes alot of compiler warnings
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/36760821
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/36760821
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/36760821
Branch: refs/heads/develop
Commit: 3676082113c6f11ac6aa286c3905304bed7b2dc6
Parents: 00284f5
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Nov 17 14:11:53 2015 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Nov 17 14:11:53 2015 +0100
----------------------------------------------------------------------
framework/private/test/attribute_test.cpp | 4 ++--
framework/private/test/bundle_archive_test.cpp | 17 -----------------
framework/private/test/bundle_cache_test.cpp | 17 -----------------
framework/private/test/bundle_context_test.cpp | 11 -----------
framework/private/test/bundle_test.cpp | 1 +
framework/private/test/capability_test.cpp | 2 +-
framework/private/test/module_test.cpp | 1 -
framework/private/test/resolver_test.cpp | 1 -
framework/private/test/service_reference_test.cpp | 1 +
.../private/test/service_registration_test.cpp | 3 ---
.../test/service_tracker_customizer_test.cpp | 1 -
framework/private/test/service_tracker_test.cpp | 8 ++++----
framework/private/test/version_range_test.cpp | 2 --
framework/private/test/version_test.cpp | 4 +---
framework/private/test/wire_test.cpp | 1 -
framework/tst/multiple_frameworks_test.cpp | 1 -
framework/tst/single_framework_test.cpp | 1 -
.../json_rpc_tests.cpp | 6 +++---
.../rsa_tst/rsa_client_server_tests.cpp | 2 --
.../private/test/rsa_client_server_tests.cpp | 2 +-
20 files changed, 14 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/attribute_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/attribute_test.cpp b/framework/private/test/attribute_test.cpp
index c378b3a..feba87c 100644
--- a/framework/private/test/attribute_test.cpp
+++ b/framework/private/test/attribute_test.cpp
@@ -98,7 +98,7 @@ TEST(attribute, getKey) {
attribute->value = value;
char *actual = NULL;
- celix_status_t status = attribute_getKey(attribute, &actual);
+ attribute_getKey(attribute, &actual);
STRCMP_EQUAL(key, actual);
free(attribute);
@@ -113,7 +113,7 @@ TEST(attribute, getValue) {
attribute->value = value;
char *actual = NULL;
- celix_status_t status = attribute_getValue(attribute, &actual);
+ attribute_getValue(attribute, &actual);
STRCMP_EQUAL(value, actual);
free(attribute);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/bundle_archive_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/bundle_archive_test.cpp b/framework/private/test/bundle_archive_test.cpp
index f5baa2d..85c6b38 100644
--- a/framework/private/test/bundle_archive_test.cpp
+++ b/framework/private/test/bundle_archive_test.cpp
@@ -44,23 +44,6 @@ int main(int argc, char** argv) {
return RUN_ALL_TESTS(argc, argv);
}
-static char* my_strdup(const char* s) {
- if (s == NULL) {
- return NULL;
- }
-
- size_t len = strlen(s);
-
- char *d = (char*) calloc(len + 1, sizeof(char));
-
- if (d == NULL) {
- return NULL;
- }
-
- strncpy(d, s, len);
- return d;
-}
-
static int remove_directory_recursive(const char *path) {
DIR *d = opendir(path);
size_t path_len = strlen(path);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/bundle_cache_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/bundle_cache_test.cpp b/framework/private/test/bundle_cache_test.cpp
index 93794ce..5c63c5b 100644
--- a/framework/private/test/bundle_cache_test.cpp
+++ b/framework/private/test/bundle_cache_test.cpp
@@ -45,23 +45,6 @@ int main(int argc, char** argv) {
return RUN_ALL_TESTS(argc, argv);
}
-static char* my_strdup(const char* s) {
- if (s == NULL) {
- return NULL;
- }
-
- size_t len = strlen(s);
-
- char *d = (char*) calloc(len + 1, sizeof(char));
-
- if (d == NULL) {
- return NULL;
- }
-
- strncpy(d, s, len);
- return d;
-}
-
TEST_GROUP(bundle_cache) {
void setup(void) {
}
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/bundle_context_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/bundle_context_test.cpp b/framework/private/test/bundle_context_test.cpp
index fcd6dfa..fc011df 100644
--- a/framework/private/test/bundle_context_test.cpp
+++ b/framework/private/test/bundle_context_test.cpp
@@ -305,7 +305,6 @@ TEST(bundle_context, ungetServiceReference) {
.withParameter("bundle", bundle)
.withParameter("reference", reference);
- service_reference_pt actualReference = NULL;
LONGS_EQUAL(CELIX_SUCCESS, bundleContext_ungetServiceReference(context, reference));
LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, bundleContext_ungetServiceReference(context, NULL));
@@ -320,7 +319,6 @@ TEST(bundle_context, getService) {
context->framework = framework;
context->bundle = bundle;
- char serviceName[] = "service";
service_reference_pt serviceReference = (service_reference_pt) 0x30;
void *service = (void *) 0x40;
@@ -350,7 +348,6 @@ TEST(bundle_context, ungetService) {
context->framework = framework;
context->bundle = bundle;
- char serviceName[] = "service";
service_reference_pt serviceReference = (service_reference_pt) 0x30;
bool result = true;
@@ -441,11 +438,9 @@ TEST(bundle_context, addServiceListener) {
.withParameter("filter", filter)
.andReturnValue(CELIX_SUCCESS);
- bundle_pt actualBundle = NULL;
celix_status_t status = bundleContext_addServiceListener(context, listener, filter);
LONGS_EQUAL(CELIX_SUCCESS, status);
- actualBundle = NULL;
status = bundleContext_addServiceListener(context, NULL, filter);
LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, status);
}
@@ -466,11 +461,9 @@ TEST(bundle_context, removeServiceListener) {
.withParameter("listener", listener)
.andReturnValue(CELIX_SUCCESS);
- bundle_pt actualBundle = NULL;
celix_status_t status = bundleContext_removeServiceListener(context, listener);
LONGS_EQUAL(CELIX_SUCCESS, status);
- actualBundle = NULL;
status = bundleContext_removeServiceListener(context, NULL);
LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, status);
}
@@ -491,11 +484,9 @@ TEST(bundle_context, addBundleListener) {
.withParameter("listener", listener)
.andReturnValue(CELIX_SUCCESS);
- bundle_pt actualBundle = NULL;
celix_status_t status = bundleContext_addBundleListener(context, listener);
LONGS_EQUAL(CELIX_SUCCESS, status);
- actualBundle = NULL;
status = bundleContext_addBundleListener(context, NULL);
LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, status);
}
@@ -516,11 +507,9 @@ TEST(bundle_context, removeBundleListener) {
.withParameter("listener", listener)
.andReturnValue(CELIX_SUCCESS);
- bundle_pt actualBundle = NULL;
celix_status_t status = bundleContext_removeBundleListener(context, listener);
LONGS_EQUAL(CELIX_SUCCESS, status);
- actualBundle = NULL;
status = bundleContext_removeBundleListener(context, NULL);
LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, status);
}
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/bundle_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/bundle_test.cpp b/framework/private/test/bundle_test.cpp
index bf17991..17b719e 100644
--- a/framework/private/test/bundle_test.cpp
+++ b/framework/private/test/bundle_test.cpp
@@ -711,6 +711,7 @@ TEST(bundle, isLockable) {
bool lockable = false;
celix_status_t status = bundle_isLockable(bundle, &lockable);
+ LONGS_EQUAL(CELIX_SUCCESS, status);
// FAIL("Test not fully implemented");
free(bundle);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/capability_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/capability_test.cpp b/framework/private/test/capability_test.cpp
index 146f1f9..4fd8435 100644
--- a/framework/private/test/capability_test.cpp
+++ b/framework/private/test/capability_test.cpp
@@ -88,7 +88,7 @@ TEST(capability, create) {
.andReturnValue(CELIX_SUCCESS);
capability_pt capability = NULL;
- celix_status_t status = capability_create(module, directives, attributes, &capability);
+ capability_create(module, directives, attributes, &capability);
mock().expectOneCall("attribute_destroy")
.withParameter("attribute", serviceAttribute);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/module_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/module_test.cpp b/framework/private/test/module_test.cpp
index 7b56f2c..a5af381 100644
--- a/framework/private/test/module_test.cpp
+++ b/framework/private/test/module_test.cpp
@@ -206,7 +206,6 @@ TEST(module, wires){
char * id2 = my_strdup("43");
linked_list_pt capabilities2 = NULL;
linked_list_pt requirements2 = NULL;
- linked_list_pt wires2 = NULL;
//create module
linkedList_create(&capabilities);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/resolver_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/resolver_test.cpp b/framework/private/test/resolver_test.cpp
index 753acf5..d27178d 100644
--- a/framework/private/test/resolver_test.cpp
+++ b/framework/private/test/resolver_test.cpp
@@ -97,7 +97,6 @@ TEST(resolver, resolve){
requirement_pt req2= (requirement_pt) 0x07;
capability_pt cap = (capability_pt) 0x08;
capability_pt cap2= (capability_pt) 0x09;
- wire_pt get_wire;
importer_wires_pt get_importer_wires;
linked_list_pt get_wire_map;
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/service_reference_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_reference_test.cpp b/framework/private/test/service_reference_test.cpp
index cb5c0b4..4b0715b 100644
--- a/framework/private/test/service_reference_test.cpp
+++ b/framework/private/test/service_reference_test.cpp
@@ -120,6 +120,7 @@ TEST(service_reference, getUsingBundle) {
array_list_pt actual = NULL;
celix_status_t status = serviceReference_getUsingBundles(reference, &actual);
+ LONGS_EQUAL(status,CELIX_SUCCESS);
POINTERS_EQUAL(bundles, actual);
LONGS_EQUAL(1, arrayList_size(actual));
POINTERS_EQUAL(bundle, arrayList_get(actual, 0));
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/service_registration_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_registration_test.cpp b/framework/private/test/service_registration_test.cpp
index 8677e9f..7245c9b 100644
--- a/framework/private/test/service_registration_test.cpp
+++ b/framework/private/test/service_registration_test.cpp
@@ -53,7 +53,6 @@ TEST_GROUP(service_registration) {
};
TEST(service_registration, create) {
- service_registry_pt registry = (service_registry_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
std::string serviceName = "service";
long serviceId = 1l;
@@ -90,7 +89,6 @@ TEST(service_registration, create) {
}
TEST(service_registration, createServiceFactory) {
- service_registry_pt registry = (service_registry_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
std::string serviceName = "service";
long serviceId = 1l;
@@ -177,7 +175,6 @@ TEST(service_registration, unregisterValid) {
}
TEST(service_registration, unregisterInvalid) {
- service_registry_pt registry = (service_registry_pt) 0x10;
bundle_pt bundle = (bundle_pt) 0x20;
service_registration_pt registration = (service_registration_pt) malloc(sizeof(*registration));
registration->bundle = bundle;
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/service_tracker_customizer_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_tracker_customizer_test.cpp b/framework/private/test/service_tracker_customizer_test.cpp
index 7042182..2c3c4f0 100644
--- a/framework/private/test/service_tracker_customizer_test.cpp
+++ b/framework/private/test/service_tracker_customizer_test.cpp
@@ -93,7 +93,6 @@ TEST(service_tracker_customizer, create) {
TEST(service_tracker_customizer, createIllegalArgument) {
mock().expectOneCall("framework_logCode").withParameter("code", CELIX_ILLEGAL_ARGUMENT);
- void *handle = (void *) 0x10;
service_tracker_customizer_pt customizer = NULL;
celix_status_t status = serviceTrackerCustomizer_create(
NULL,
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/service_tracker_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_tracker_test.cpp b/framework/private/test/service_tracker_test.cpp
index de9e3c0..24dbb7e 100644
--- a/framework/private/test/service_tracker_test.cpp
+++ b/framework/private/test/service_tracker_test.cpp
@@ -94,6 +94,7 @@ TEST(service_tracker, destroy) {
bundle_context_pt ctx = (bundle_context_pt) 0x123;
std::string filter = "(objectClass=test)";
status = serviceTracker_createWithFilter(ctx, (char *) filter.c_str(), NULL, &tracker);
+ LONGS_EQUAL(CELIX_SUCCESS, status);
service_listener_pt listener = (service_listener_pt) calloc(1, sizeof(serviceListener));
tracker->listener = listener;
@@ -104,6 +105,7 @@ TEST(service_tracker, destroy) {
.andReturnValue(CELIX_SUCCESS);
status = serviceTracker_destroy(tracker);
+ LONGS_EQUAL(CELIX_SUCCESS, status);
}
TEST(service_tracker, open) {
@@ -236,7 +238,6 @@ TEST(service_tracker, open_withRefsAndTracked) {
array_list_pt refs = NULL;
arrayList_create(&refs);
arrayList_add(refs, ref);
- void *src = (void *) 0x345;
// mock().strictOrder();
mock()
@@ -741,7 +742,6 @@ TEST(service_tracker, serviceChangedRegisteredCustomizer) {
tracker->customizer = customizer;
service_reference_pt ref = (service_reference_pt) 0x51;
- void *src = (void *) 0x345;
service_event_pt event = (service_event_pt) malloc(sizeof(*event));
event->type = OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED;
@@ -798,8 +798,8 @@ TEST(service_tracker, serviceChangedModifiedCustomizer) {
listener->handle = tracker;
service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
tracker->customizer = customizer;
- adding_callback_pt adding_func = NULL;
- added_callback_pt added_func = NULL;
+ //adding_callback_pt adding_func = NULL;
+ //added_callback_pt added_func = NULL;
// new tracker->tracked
array_list_pt tracked = NULL;
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/version_range_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/version_range_test.cpp b/framework/private/test/version_range_test.cpp
index d16c38b..1e1336c 100644
--- a/framework/private/test/version_range_test.cpp
+++ b/framework/private/test/version_range_test.cpp
@@ -121,7 +121,6 @@ TEST(version_range, createInfinite) {
}
TEST(version_range, isInRange) {
- celix_status_t status = CELIX_SUCCESS;
bool result;
version_range_pt range = NULL;
version_pt version = (version_pt) malloc(sizeof(*version));
@@ -206,7 +205,6 @@ TEST(version_range, isInRange) {
}
TEST(version_range, parse) {
- celix_status_t status = CELIX_SUCCESS;
version_range_pt range = NULL;
version_pt low = (version_pt) malloc(sizeof(*low));
version_pt high = (version_pt) malloc(sizeof(*high));
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/version_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/version_test.cpp b/framework/private/test/version_test.cpp
index 51d734d..1e0af78 100644
--- a/framework/private/test/version_test.cpp
+++ b/framework/private/test/version_test.cpp
@@ -75,7 +75,6 @@ TEST_GROUP(version) {
TEST(version, create) {
mock().expectNCalls(2, "framework_logCode").withParameter("code", CELIX_ILLEGAL_ARGUMENT);
version_pt version = NULL;
- celix_status_t status = CELIX_SUCCESS;
char * str;
// str = my_strdup("abc");
@@ -119,7 +118,6 @@ TEST(version, create) {
TEST(version, clone) {
version_pt version = NULL, clone = NULL;
- celix_status_t status = CELIX_SUCCESS;
char * str;
str = my_strdup("abc");
@@ -327,7 +325,7 @@ TEST(version, compare) {
}
TEST(version, toString) {
- version_pt version = NULL, compare = NULL;
+ version_pt version = NULL;
celix_status_t status = CELIX_SUCCESS;
char * str;
char *result = NULL;
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/private/test/wire_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/wire_test.cpp b/framework/private/test/wire_test.cpp
index 6af4d01..bbcf579 100644
--- a/framework/private/test/wire_test.cpp
+++ b/framework/private/test/wire_test.cpp
@@ -63,7 +63,6 @@ TEST(wire, create) {
module_pt module = (module_pt) 0x01;
capability_pt cap = (capability_pt) 0x02;
requirement_pt req = (requirement_pt) 0x03;
- celix_status_t status;
wire_pt wire = NULL;
LONGS_EQUAL(CELIX_SUCCESS, wire_create(module, req, module, cap, &wire));
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/tst/multiple_frameworks_test.cpp
----------------------------------------------------------------------
diff --git a/framework/tst/multiple_frameworks_test.cpp b/framework/tst/multiple_frameworks_test.cpp
index 14756d6..6fe1377 100644
--- a/framework/tst/multiple_frameworks_test.cpp
+++ b/framework/tst/multiple_frameworks_test.cpp
@@ -66,7 +66,6 @@ extern "C" {
}
static void teardownFm(void) {
- int rc = 0;
celixLauncher_stop(serverFramework);
celixLauncher_waitForShutdown(serverFramework);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/framework/tst/single_framework_test.cpp
----------------------------------------------------------------------
diff --git a/framework/tst/single_framework_test.cpp b/framework/tst/single_framework_test.cpp
index 32212ac..e3a0fa6 100644
--- a/framework/tst/single_framework_test.cpp
+++ b/framework/tst/single_framework_test.cpp
@@ -49,7 +49,6 @@ extern "C" {
}
static void teardownFm(void) {
- int rc = 0;
celixLauncher_stop(framework);
celixLauncher_waitForShutdown(framework);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp
index cf0b7eb..8b4044d 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp
@@ -121,11 +121,11 @@ static void stdLog(void *handle, int level, const char *file, int line, const ch
assert(out != NULL);
assert(*out == NULL);
double total = 0.0;
- int count = 0;
+ unsigned int count = 0;
double max = DBL_MIN;
double min = DBL_MAX;
- int i;
+ unsigned int i;
for (i = 0; i<input.len; i += 1) {
total += input.buf[i];
count += 1;
@@ -302,7 +302,7 @@ static void stdLog(void *handle, int level, const char *file, int line, const ch
CHECK_EQUAL(2.5, result->buf[1]->b);
- int i;
+ unsigned int i;
for (i = 0; i < result->len; i +=1 ) {
free(result->buf[i]);
}
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp b/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
index 24c8e1c..b4775f7 100644
--- a/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
+++ b/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
@@ -73,8 +73,6 @@ extern "C" {
}
static void teardownFm(void) {
- int rc = 0;
-
celixLauncher_stop(serverFramework);
celixLauncher_waitForShutdown(serverFramework);
celixLauncher_destroy(serverFramework);
http://git-wip-us.apache.org/repos/asf/celix/blob/36760821/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp b/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
index 1c10c72..e15c74a 100644
--- a/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
+++ b/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
@@ -94,7 +94,7 @@ static void test1(void) {
celix_status_t status = CELIX_BUNDLE_EXCEPTION;
service_reference_pt ref = NULL;
calculator_service_pt calcService = NULL;
- int retries = 12;
+ int retries = 24;
while (ref == NULL && retries > 0) {
printf("Waiting for service .. %d\n", retries);