Return-Path: X-Original-To: apmail-incubator-celix-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-celix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A48E117B6 for ; Sat, 7 Jun 2014 12:45:03 +0000 (UTC) Received: (qmail 47305 invoked by uid 500); 7 Jun 2014 12:45:02 -0000 Delivered-To: apmail-incubator-celix-commits-archive@incubator.apache.org Received: (qmail 47279 invoked by uid 500); 7 Jun 2014 12:45:02 -0000 Mailing-List: contact celix-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: celix-dev@incubator.apache.org Delivered-To: mailing list celix-commits@incubator.apache.org Received: (qmail 47272 invoked by uid 99); 7 Jun 2014 12:45:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 12:45:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 12:44:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A61F323889BB; Sat, 7 Jun 2014 12:44:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1601103 [2/3] - in /incubator/celix/trunk: dependency_manager/private/src/ deployment_admin/private/src/ device_access/device_access/private/src/ device_access/example/refining_driver/private/src/ event_admin/event_admin/private/src/ event... Date: Sat, 07 Jun 2014 12:44:34 -0000 To: celix-commits@incubator.apache.org From: abroekhuis@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140607124438.A61F323889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/celix/trunk/framework/private/src/manifest_parser.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/manifest_parser.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/manifest_parser.c (original) +++ incubator/celix/trunk/framework/private/src/manifest_parser.c Sat Jun 7 12:44:31 2014 @@ -25,7 +25,6 @@ */ #include #include -#include #include "utils.h" #include "constants.h" @@ -50,18 +49,18 @@ struct manifestParser { linked_list_pt requirements; }; -static linked_list_pt manifestParser_parseImportHeader(char * header, apr_pool_t *memory_pool); -static linked_list_pt manifestParser_parseExportHeader(module_pt module, char * header, apr_pool_t *memory_pool); -static linked_list_pt manifestParser_parseDelimitedString(char * value, char * delim, apr_pool_t *memory_pool); -static linked_list_pt manifestParser_parseStandardHeaderClause(char * clauseString, apr_pool_t *memory_pool); -static linked_list_pt manifestParser_parseStandardHeader(char * header, apr_pool_t *memory_pool); +static linked_list_pt manifestParser_parseImportHeader(char * header); +static linked_list_pt manifestParser_parseExportHeader(module_pt module, char * header); +static linked_list_pt manifestParser_parseDelimitedString(char * value, char * delim); +static linked_list_pt manifestParser_parseStandardHeaderClause(char * clauseString); +static linked_list_pt manifestParser_parseStandardHeader(char * header); -celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, apr_pool_t *memory_pool, manifest_parser_pt *manifest_parser) { +celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, manifest_parser_pt *manifest_parser) { celix_status_t status; manifest_parser_pt parser; status = CELIX_SUCCESS; - parser = (manifest_parser_pt) apr_pcalloc(memory_pool, sizeof(*parser)); + parser = (manifest_parser_pt) malloc(sizeof(*parser)); if (parser) { char * bundleVersion = NULL; char * bundleSymbolicName = NULL; @@ -81,8 +80,8 @@ celix_status_t manifestParser_create(mod parser->bundleSymbolicName = bundleSymbolicName; } - parser->capabilities = manifestParser_parseExportHeader(owner, manifest_getValue(manifest, OSGI_FRAMEWORK_EXPORT_LIBRARY), memory_pool); - parser->requirements = manifestParser_parseImportHeader(manifest_getValue(manifest, OSGI_FRAMEWORK_IMPORT_LIBRARY), memory_pool); + parser->capabilities = manifestParser_parseExportHeader(owner, manifest_getValue(manifest, OSGI_FRAMEWORK_EXPORT_LIBRARY)); + parser->requirements = manifestParser_parseImportHeader(manifest_getValue(manifest, OSGI_FRAMEWORK_IMPORT_LIBRARY)); *manifest_parser = parser; @@ -96,66 +95,56 @@ celix_status_t manifestParser_create(mod return status; } -static linked_list_pt manifestParser_parseDelimitedString(char * value, char * delim, apr_pool_t *memory_pool) { +static linked_list_pt manifestParser_parseDelimitedString(char * value, char * delim) { linked_list_pt list; - apr_pool_t *temp_pool; if (linkedList_create(&list) == CELIX_SUCCESS) { if (value != NULL) { - if (apr_pool_create(&temp_pool, NULL) == APR_SUCCESS) { - int CHAR = 1; - int DELIMITER = 2; - int STARTQUOTE = 4; - int ENDQUOTE = 8; - - char * buffer = (char *) apr_pcalloc(temp_pool, sizeof(char) * 512); - if (buffer != NULL) { - int expecting = (CHAR | DELIMITER | STARTQUOTE); - unsigned int i; - - buffer[0] = '\0'; - - for (i = 0; i < strlen(value); i++) { - char c = value[i]; - - bool isDelimiter = (strchr(delim, c) != NULL); - bool isQuote = (c == '"'); - - if (isDelimiter && ((expecting & DELIMITER) > 0)) { - linkedList_addElement(list, apr_pstrdup(memory_pool, buffer)); - buffer[0] = '\0'; - expecting = (CHAR | DELIMITER | STARTQUOTE); - } else if (isQuote && ((expecting & STARTQUOTE) > 0)) { - char tmp[2]; - tmp[0] = c; - tmp[1] = '\0'; - strcat(buffer, tmp); - expecting = CHAR | ENDQUOTE; - } else if (isQuote && ((expecting & ENDQUOTE) > 0)) { - char tmp[2]; - tmp[0] = c; - tmp[1] = '\0'; - strcat(buffer, tmp); - expecting = (CHAR | STARTQUOTE | DELIMITER); - } else if ((expecting & CHAR) > 0) { - char tmp[2]; - tmp[0] = c; - tmp[1] = '\0'; - strcat(buffer, tmp); - } else { - apr_pool_destroy(temp_pool); - return NULL; - } - } - - if (strlen(buffer) > 0) { - linkedList_addElement(list, apr_pstrdup(memory_pool, utils_stringTrim(buffer))); - } + int CHAR = 1; + int DELIMITER = 2; + int STARTQUOTE = 4; + int ENDQUOTE = 8; + + char buffer[512]; + int expecting = (CHAR | DELIMITER | STARTQUOTE); + unsigned int i; + + buffer[0] = '\0'; + + for (i = 0; i < strlen(value); i++) { + char c = value[i]; + + bool isDelimiter = (strchr(delim, c) != NULL); + bool isQuote = (c == '"'); + + if (isDelimiter && ((expecting & DELIMITER) > 0)) { + linkedList_addElement(list, strdup(buffer)); + buffer[0] = '\0'; + expecting = (CHAR | DELIMITER | STARTQUOTE); + } else if (isQuote && ((expecting & STARTQUOTE) > 0)) { + char tmp[2]; + tmp[0] = c; + tmp[1] = '\0'; + strcat(buffer, tmp); + expecting = CHAR | ENDQUOTE; + } else if (isQuote && ((expecting & ENDQUOTE) > 0)) { + char tmp[2]; + tmp[0] = c; + tmp[1] = '\0'; + strcat(buffer, tmp); + expecting = (CHAR | STARTQUOTE | DELIMITER); + } else if ((expecting & CHAR) > 0) { + char tmp[2]; + tmp[0] = c; + tmp[1] = '\0'; + strcat(buffer, tmp); + } else { + return NULL; } + } - if (temp_pool) { - apr_pool_destroy(temp_pool); - } + if (strlen(buffer) > 0) { + linkedList_addElement(list, strdup(utils_stringTrim(buffer))); } } } @@ -163,99 +152,92 @@ static linked_list_pt manifestParser_par return list; } -static linked_list_pt manifestParser_parseStandardHeaderClause(char * clauseString, apr_pool_t *memory_pool) { +static linked_list_pt manifestParser_parseStandardHeaderClause(char * clauseString) { linked_list_pt paths; - apr_pool_t *temp_pool; linked_list_pt clause; linked_list_pt pieces; clause = NULL; pieces = NULL; - if (apr_pool_create(&temp_pool, memory_pool) == APR_SUCCESS) { - pieces = manifestParser_parseDelimitedString(clauseString, ";", temp_pool); + pieces = manifestParser_parseDelimitedString(clauseString, ";"); - if (linkedList_create(&paths) == CELIX_SUCCESS) { - int pathCount = 0; - int pieceIdx; - hash_map_pt dirsMap = NULL; - hash_map_pt attrsMap = NULL; - char * sepPtr; - char * sep; - - for (pieceIdx = 0; pieceIdx < linkedList_size(pieces); pieceIdx++) { - char * piece = linkedList_get(pieces, pieceIdx); - if (strchr(piece, '=') != NULL) { - break; - } else { - linkedList_addElement(paths, apr_pstrdup(memory_pool, piece)); - pathCount++; - } + if (linkedList_create(&paths) == CELIX_SUCCESS) { + int pathCount = 0; + int pieceIdx; + hash_map_pt dirsMap = NULL; + hash_map_pt attrsMap = NULL; + char * sepPtr; + char * sep; + + for (pieceIdx = 0; pieceIdx < linkedList_size(pieces); pieceIdx++) { + char * piece = linkedList_get(pieces, pieceIdx); + if (strchr(piece, '=') != NULL) { + break; + } else { + linkedList_addElement(paths, strdup(piece)); + pathCount++; } + } + + if (pathCount == 0) { + return NULL; + } - if (pathCount == 0) { + dirsMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL); + attrsMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL); + + + for (pieceIdx = pathCount; pieceIdx < linkedList_size(pieces); pieceIdx++) { + char * key; + char * value; + char * DIRECTIVE_SEP = ":="; + char * ATTRIBUTE_SEP = "="; + char * piece = linkedList_get(pieces, pieceIdx); + if ((sepPtr = strstr(piece, DIRECTIVE_SEP)) != NULL) { + sep = DIRECTIVE_SEP; + } else if ((sepPtr = strstr(piece, ATTRIBUTE_SEP)) != NULL) { + sep = ATTRIBUTE_SEP; + } else { return NULL; } - dirsMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL); - attrsMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL); - - - for (pieceIdx = pathCount; pieceIdx < linkedList_size(pieces); pieceIdx++) { - char * key; - char * value; - char * DIRECTIVE_SEP = ":="; - char * ATTRIBUTE_SEP = "="; - char * piece = linkedList_get(pieces, pieceIdx); - if ((sepPtr = strstr(piece, DIRECTIVE_SEP)) != NULL) { - sep = DIRECTIVE_SEP; - } else if ((sepPtr = strstr(piece, ATTRIBUTE_SEP)) != NULL) { - sep = ATTRIBUTE_SEP; - } else { - return NULL; - } + key = string_ndup(piece, sepPtr - piece); + value = strdup(sepPtr+strlen(sep)); - key = string_ndup(piece, sepPtr - piece); - value = apr_pstrdup(temp_pool, sepPtr+strlen(sep)); + if (value[0] == '"' && value[strlen(value) -1] == '"') { + char * oldV = strdup(value); + int len = strlen(oldV) - 2; + value = (char *) malloc(sizeof(char) * len+1); + value[0] = '\0'; + value = strncpy(value, oldV+1, strlen(oldV) - 2); + value[len] = '\0'; + } - if (value[0] == '"' && value[strlen(value) -1] == '"') { - char * oldV = apr_pstrdup(memory_pool, value); - int len = strlen(oldV) - 2; - value = (char *) apr_pcalloc(memory_pool, sizeof(char) * len+1); - value[0] = '\0'; - value = strncpy(value, oldV+1, strlen(oldV) - 2); - value[len] = '\0'; + if (strcmp(sep, DIRECTIVE_SEP) == 0) { + // Not implemented + } else { + attribute_pt attr = NULL; + if (hashMap_containsKey(attrsMap, key)) { + return NULL; } - if (strcmp(sep, DIRECTIVE_SEP) == 0) { - // Not implemented - } else { - attribute_pt attr = NULL; - if (hashMap_containsKey(attrsMap, key)) { - return NULL; - } - - if (attribute_create(key, value, &attr) == CELIX_SUCCESS) { - hashMap_put(attrsMap, key, attr); - } + if (attribute_create(key, value, &attr) == CELIX_SUCCESS) { + hashMap_put(attrsMap, key, attr); } } - - if (linkedList_create(&clause) == CELIX_SUCCESS) { - linkedList_addElement(clause, paths); - linkedList_addElement(clause, dirsMap); - linkedList_addElement(clause, attrsMap); - } } - } - if (temp_pool != NULL) { - apr_pool_destroy(temp_pool); + if (linkedList_create(&clause) == CELIX_SUCCESS) { + linkedList_addElement(clause, paths); + linkedList_addElement(clause, dirsMap); + linkedList_addElement(clause, attrsMap); + } } return clause; } -static linked_list_pt manifestParser_parseStandardHeader(char * header, apr_pool_t *memory_pool) { +static linked_list_pt manifestParser_parseStandardHeader(char * header) { int i; char *clauseString; linked_list_pt clauseStrings = NULL; @@ -267,11 +249,11 @@ static linked_list_pt manifestParser_par return NULL; } - clauseStrings = manifestParser_parseDelimitedString(apr_pstrdup(memory_pool, header), ",", memory_pool); + clauseStrings = manifestParser_parseDelimitedString(strdup(header), ","); if (clauseStrings != NULL) { for (i = 0; i < linkedList_size(clauseStrings); i++) { clauseString = (char *) linkedList_get(clauseStrings, i); - linkedList_addElement(completeList, manifestParser_parseStandardHeaderClause(clauseString, memory_pool)); + linkedList_addElement(completeList, manifestParser_parseStandardHeaderClause(clauseString)); } } } @@ -280,15 +262,13 @@ static linked_list_pt manifestParser_par return completeList; } -static linked_list_pt manifestParser_parseImportHeader(char * header, apr_pool_t *memory_pool) { - apr_pool_t *temp_pool; +static linked_list_pt manifestParser_parseImportHeader(char * header) { linked_list_pt clauses; linked_list_pt requirements; - if (apr_pool_create(&temp_pool, memory_pool) == APR_SUCCESS) { int clauseIdx; linked_list_iterator_pt iter; - clauses = manifestParser_parseStandardHeader(header, memory_pool); + clauses = manifestParser_parseStandardHeader(header); linkedList_create(&requirements); for (clauseIdx = 0; clauseIdx < linkedList_size(clauses); clauseIdx++) { @@ -307,7 +287,7 @@ static linked_list_pt manifestParser_par return NULL; } - if (attribute_create(apr_pstrdup(memory_pool, "service"), path, &name) == CELIX_SUCCESS) { + if (attribute_create(strdup("service"), path, &name) == CELIX_SUCCESS) { char *key = NULL; attribute_getKey(name, &key); hashMap_put(attributes, key, name); @@ -328,18 +308,15 @@ static linked_list_pt manifestParser_par } linkedListIterator_destroy(iter); - apr_pool_destroy(temp_pool); - } - return requirements; } -static linked_list_pt manifestParser_parseExportHeader(module_pt module, char * header, apr_pool_t *memory_pool) { +static linked_list_pt manifestParser_parseExportHeader(module_pt module, char * header) { linked_list_pt clauses; linked_list_pt capabilities; int clauseIdx; linked_list_iterator_pt iter; - clauses = manifestParser_parseStandardHeader(header, memory_pool); + clauses = manifestParser_parseStandardHeader(header); linkedList_create(&capabilities); @@ -359,7 +336,7 @@ static linked_list_pt manifestParser_par return NULL; } - if (attribute_create(apr_pstrdup(memory_pool, "service"), path, &name) == CELIX_SUCCESS) { + if (attribute_create(strdup("service"), path, &name) == CELIX_SUCCESS) { char *key = NULL; attribute_getKey(name, &key); hashMap_put(attributes, key, name); @@ -382,16 +359,16 @@ static linked_list_pt manifestParser_par return capabilities; } -celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, apr_pool_t *pool, char **symbolicName) { - *symbolicName = apr_pstrdup(pool, parser->bundleSymbolicName); +celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, char **symbolicName) { + *symbolicName = strdup(parser->bundleSymbolicName); return CELIX_SUCCESS; } -celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, apr_pool_t *pool, version_pt *version) { +celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, version_pt *version) { return version_clone(parser->bundleVersion, version); } -celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *capabilities) { +celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, linked_list_pt *capabilities) { celix_status_t status = CELIX_SUCCESS; status = linkedList_clone(parser->capabilities, capabilities); @@ -399,7 +376,7 @@ celix_status_t manifestParser_getCapabil return status; } -celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *requirements) { +celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, linked_list_pt *requirements) { celix_status_t status = CELIX_SUCCESS; status = linkedList_clone(parser->requirements, requirements); Modified: incubator/celix/trunk/framework/private/src/module.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/module.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/module.c (original) +++ incubator/celix/trunk/framework/private/src/module.c Sat Jun 7 12:44:31 2014 @@ -26,7 +26,6 @@ #include #include #include -#include #include "module.h" #include "manifest_parser.h" @@ -53,44 +52,33 @@ struct module { }; module_pt module_create(manifest_pt headerMap, char * moduleId, bundle_pt bundle) { - module_pt module; + module_pt module = NULL; manifest_parser_pt mp; - apr_pool_t *pool; - apr_pool_t *bundlePool = NULL; - - module = NULL; - pool = NULL; if (headerMap != NULL) { - bundle_getMemoryPool(bundle, &bundlePool); - - module = (module_pt) apr_palloc(bundlePool, sizeof(*module)); + module = (module_pt) malloc(sizeof(*module)); module->headerMap = headerMap; - module->id = apr_pstrdup(bundlePool, moduleId); + module->id = strdup(moduleId); module->bundle = bundle; module->resolved = false; module->dependentImporters = NULL; arrayList_create(&module->dependentImporters); - if (apr_pool_create(&pool, bundlePool) == APR_SUCCESS) { - if (manifestParser_create(module, headerMap, pool, &mp) == CELIX_SUCCESS) { - module->symbolicName = NULL; - manifestParser_getSymbolicName(mp, bundlePool, &module->symbolicName); - - module->version = NULL; - manifestParser_getBundleVersion(mp, bundlePool, &module->version); - - module->capabilities = NULL; - manifestParser_getCapabilities(mp, bundlePool, &module->capabilities); - - module->requirements = NULL; - manifestParser_getRequirements(mp, bundlePool, &module->requirements); - - module->wires = NULL; - } else { - apr_pool_destroy(pool); - } + if (manifestParser_create(module, headerMap, &mp) == CELIX_SUCCESS) { + module->symbolicName = NULL; + manifestParser_getSymbolicName(mp, &module->symbolicName); + + module->version = NULL; + manifestParser_getBundleVersion(mp, &module->version); + + module->capabilities = NULL; + manifestParser_getCapabilities(mp, &module->capabilities); + + module->requirements = NULL; + manifestParser_getRequirements(mp, &module->requirements); + + module->wires = NULL; } } @@ -99,28 +87,22 @@ module_pt module_create(manifest_pt head module_pt module_createFrameworkModule(bundle_pt bundle) { module_pt module; - apr_pool_t *dependentImporters_pool; - apr_pool_t *bundlePool = NULL; - bundle_getMemoryPool(bundle, &bundlePool); - - module = (module_pt) apr_palloc(bundlePool, sizeof(*module)); + module = (module_pt) malloc(sizeof(*module)); if (module) { - if (apr_pool_create(&dependentImporters_pool, bundlePool) == APR_SUCCESS) { - module->id = apr_pstrdup(bundlePool, "0"); - module->symbolicName = apr_pstrdup(bundlePool, "framework"); - module->version = NULL; - version_createVersion(1, 0, 0, "", &module->version); - - linkedList_create(&module->capabilities); - linkedList_create(&module->requirements); - module->dependentImporters = NULL; - arrayList_create(&module->dependentImporters); - module->wires = NULL; - module->headerMap = NULL; - module->resolved = false; - module->bundle = bundle; - } + module->id = strdup("0"); + module->symbolicName = strdup("framework"); + module->version = NULL; + version_createVersion(1, 0, 0, "", &module->version); + + linkedList_create(&module->capabilities); + linkedList_create(&module->requirements); + module->dependentImporters = NULL; + arrayList_create(&module->dependentImporters); + module->wires = NULL; + module->headerMap = NULL; + module->resolved = false; + module->bundle = bundle; } return module; } Modified: incubator/celix/trunk/framework/private/src/resolver.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/resolver.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/resolver.c (original) +++ incubator/celix/trunk/framework/private/src/resolver.c Sat Jun 7 12:44:31 2014 @@ -26,7 +26,6 @@ #include #include #include -#include #include "resolver.h" #include "linked_list_iterator.h" @@ -267,7 +266,7 @@ void resolver_addModule(module_pt module list = (capability_list_pt) malloc(sizeof(*list)); if (list != NULL) { list->serviceName = strdup(serviceName); - if (linkedList_create(&list->capabilities) == APR_SUCCESS) { + if (linkedList_create(&list->capabilities) == CELIX_SUCCESS) { linkedList_addElement(m_unresolvedServices, list); } } @@ -309,7 +308,7 @@ void resolver_moduleResolved(module_pt m bundle = module_getBundle(module); if (module_isResolved(module)) { - if (linkedList_create(&capsCopy) == APR_SUCCESS) { + if (linkedList_create(&capsCopy) == CELIX_SUCCESS) { linked_list_pt wires = NULL; for (capIdx = 0; (module_getCapabilities(module) != NULL) && (capIdx < linkedList_size(module_getCapabilities(module))); capIdx++) { @@ -354,7 +353,7 @@ void resolver_moduleResolved(module_pt m list = (capability_list_pt) malloc(sizeof(*list)); if (list != NULL) { list->serviceName = strdup(serviceName); - if (linkedList_create(&list->capabilities) == APR_SUCCESS) { + if (linkedList_create(&list->capabilities) == CELIX_SUCCESS) { linkedList_addElement(m_resolvedServices, list); } } @@ -403,8 +402,8 @@ linked_list_pt resolver_populateWireMap( candSetList = (linked_list_pt) hashMap_get(candidates, importer); - if (linkedList_create(&serviceWires) == APR_SUCCESS) { - if (linkedList_create(&emptyWires) == APR_SUCCESS) { + if (linkedList_create(&serviceWires) == CELIX_SUCCESS) { + if (linkedList_create(&emptyWires) == CELIX_SUCCESS) { int candSetIdx = 0; // hashMap_put(wireMap, importer, emptyWires); Modified: incubator/celix/trunk/framework/private/src/service_reference.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_reference.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/service_reference.c (original) +++ incubator/celix/trunk/framework/private/src/service_reference.c Sat Jun 7 12:44:31 2014 @@ -54,12 +54,12 @@ celix_status_t serviceReference_create(b return status; } -apr_status_t serviceReference_destroy(service_reference_pt reference) { +celix_status_t serviceReference_destroy(service_reference_pt reference) { serviceRegistry_removeReference(reference); reference->bundle = NULL; reference->registration = NULL; free(reference); - return APR_SUCCESS; + return CELIX_SUCCESS; } celix_status_t serviceReference_getBundle(service_reference_pt reference, bundle_pt *bundle) { Modified: incubator/celix/trunk/framework/private/src/service_registration.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registration.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/service_registration.c (original) +++ incubator/celix/trunk/framework/private/src/service_registration.c Sat Jun 7 12:44:31 2014 @@ -27,8 +27,6 @@ #include #include -#include - #include "service_registration_private.h" #include "constants.h" #include "service_factory.h" Modified: incubator/celix/trunk/framework/private/src/service_registry.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registry.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/service_registry.c (original) +++ incubator/celix/trunk/framework/private/src/service_registry.c Sat Jun 7 12:44:31 2014 @@ -25,6 +25,7 @@ */ #include #include +#include #include "service_registry_private.h" #include "service_registration.h" @@ -68,7 +69,7 @@ celix_status_t serviceRegistry_create(fr return status; } -apr_status_t serviceRegistry_destroy(service_registry_pt registry) { +celix_status_t serviceRegistry_destroy(service_registry_pt registry) { hashMap_destroy(registry->inUseMap, false, false); hashMap_destroy(registry->serviceRegistrations, false, false); arrayList_destroy(registry->listenerHooks); @@ -180,11 +181,8 @@ celix_status_t serviceRegistry_registerS celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, char * serviceName, void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration) { array_list_pt regs; - apr_pool_t *pool = NULL; celixThreadMutex_lock(®istry->mutex); - bundle_getMemoryPool(bundle, &pool); - if (isFactory) { *registration = serviceRegistration_createServiceFactory(registry, bundle, serviceName, ++registry->currentServiceId, serviceObject, dictionary); } else { @@ -365,7 +363,7 @@ celix_status_t serviceRegistry_getServic return status; } -apr_status_t serviceRegistry_removeReference(service_reference_pt reference) { +celix_status_t serviceRegistry_removeReference(service_reference_pt reference) { service_registration_pt registration = NULL; serviceReference_getServiceRegistration(reference, ®istration); @@ -375,7 +373,7 @@ apr_status_t serviceRegistry_removeRefer arrayList_removeElement(references, reference); } - return APR_SUCCESS; + return CELIX_SUCCESS; } celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bundle_pt bundle, array_list_pt *services) { @@ -460,9 +458,6 @@ void serviceRegistry_ungetServices(servi array_list_pt usages; unsigned int i; - apr_pool_t *pool = NULL; - bundle_getMemoryPool(bundle, &pool); - celixThreadMutex_lock(®istry->mutex); usages = hashMap_get(registry->inUseMap, bundle); celixThreadMutex_unlock(®istry->mutex); Modified: incubator/celix/trunk/framework/private/src/service_tracker.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/service_tracker.c (original) +++ incubator/celix/trunk/framework/private/src/service_tracker.c Sat Jun 7 12:44:31 2014 @@ -27,33 +27,26 @@ #include #include -#include - #include "service_tracker_private.h" #include "bundle_context.h" #include "constants.h" #include "service_reference.h" #include "celix_log.h" -static apr_status_t serviceTracker_destroy(void *trackerP); static celix_status_t serviceTracker_addingService(service_tracker_pt tracker, service_reference_pt reference, void **service); static celix_status_t serviceTracker_track(service_tracker_pt tracker, service_reference_pt reference, service_event_pt event); static celix_status_t serviceTracker_untrack(service_tracker_pt tracker, service_reference_pt reference, service_event_pt event); -celix_status_t serviceTracker_create(apr_pool_t *pool, bundle_context_pt context, char * service, service_tracker_customizer_pt customizer, service_tracker_pt *tracker) { +celix_status_t serviceTracker_create(bundle_context_pt context, char * service, service_tracker_customizer_pt customizer, service_tracker_pt *tracker) { celix_status_t status = CELIX_SUCCESS; if (service == NULL || *tracker != NULL) { status = CELIX_ILLEGAL_ARGUMENT; } else { if (status == CELIX_SUCCESS) { - int len = strlen(service) + strlen(OSGI_FRAMEWORK_OBJECTCLASS) + 4; - char *filter = apr_pstrcat(pool, "(", OSGI_FRAMEWORK_OBJECTCLASS, "=", service, ")", NULL); - if (filter == NULL) { - status = CELIX_ENOMEM; - } else { - serviceTracker_createWithFilter(pool, context, filter, customizer, tracker); - } + char filter[512]; + snprintf(filter, sizeof(filter), "(%s=%s)", OSGI_FRAMEWORK_OBJECTCLASS, service); + serviceTracker_createWithFilter(context, filter, customizer, tracker); } } @@ -62,19 +55,16 @@ celix_status_t serviceTracker_create(apr return status; } -celix_status_t serviceTracker_createWithFilter(apr_pool_t *pool, bundle_context_pt context, char * filter, service_tracker_customizer_pt customizer, service_tracker_pt *tracker) { +celix_status_t serviceTracker_createWithFilter(bundle_context_pt context, char * filter, service_tracker_customizer_pt customizer, service_tracker_pt *tracker) { celix_status_t status = CELIX_SUCCESS; - *tracker = (service_tracker_pt) apr_palloc(pool, sizeof(**tracker)); + *tracker = (service_tracker_pt) malloc(sizeof(**tracker)); if (!*tracker) { status = CELIX_ENOMEM; } else { - apr_pool_pre_cleanup_register(pool, *tracker, serviceTracker_destroy); - (*tracker)->context = context; - (*tracker)->filter = apr_pstrdup(pool,filter); + (*tracker)->filter = strdup(filter); - (*tracker)->pool = pool; (*tracker)->tracker = *tracker; (*tracker)->tracked = NULL; arrayList_create(&(*tracker)->tracked); @@ -87,28 +77,26 @@ celix_status_t serviceTracker_createWith return status; } -apr_status_t serviceTracker_destroy(void *trackerP) { - service_tracker_pt tracker = (service_tracker_pt) trackerP; +celix_status_t serviceTracker_destroy(service_tracker_pt tracker) { if (tracker->listener != NULL) { bundleContext_removeServiceListener(tracker->context, tracker->listener); } arrayList_destroy(tracker->tracked); - return APR_SUCCESS; + return CELIX_SUCCESS; } celix_status_t serviceTracker_open(service_tracker_pt tracker) { service_listener_pt listener; array_list_pt initial = NULL; celix_status_t status = CELIX_SUCCESS; - listener = (service_listener_pt) apr_palloc(tracker->pool, sizeof(*listener)); + listener = (service_listener_pt) malloc(sizeof(*listener)); status = bundleContext_getServiceReferences(tracker->context, NULL, tracker->filter, &initial); if (status == CELIX_SUCCESS) { service_reference_pt initial_reference; unsigned int i; - listener->pool = tracker->pool; listener->handle = tracker; listener->serviceChanged = (void *) serviceTracker_serviceChanged; status = bundleContext_addServiceListener(tracker->context, listener, tracker->filter); Modified: incubator/celix/trunk/framework/private/src/service_tracker_customizer.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker_customizer.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/service_tracker_customizer.c (original) +++ incubator/celix/trunk/framework/private/src/service_tracker_customizer.c Sat Jun 7 12:44:31 2014 @@ -29,22 +29,18 @@ #include "service_tracker_customizer_private.h" #include "celix_log.h" -static apr_status_t serviceTrackerCustomizer_destroy(void *customizerPointer); - -celix_status_t serviceTrackerCustomizer_create(apr_pool_t *pool, void *handle, +celix_status_t serviceTrackerCustomizer_create(void *handle, adding_callback_pt addingFunction, added_callback_pt addedFunction, modified_callback_pt modifiedFunction, removed_callback_pt removedFunction, service_tracker_customizer_pt *customizer) { celix_status_t status = CELIX_SUCCESS; - if (pool == NULL || handle == NULL || *customizer != NULL) { + if (handle == NULL || *customizer != NULL) { status = CELIX_ILLEGAL_ARGUMENT; } else { - *customizer = apr_palloc(pool, sizeof(**customizer)); + *customizer = malloc(sizeof(**customizer)); if (!*customizer) { status = CELIX_ENOMEM; } else { - apr_pool_pre_cleanup_register(pool, *customizer, serviceTrackerCustomizer_destroy); - (*customizer)->handle = handle; (*customizer)->addingService = addingFunction; (*customizer)->addedService = addedFunction; @@ -58,16 +54,14 @@ celix_status_t serviceTrackerCustomizer_ return status; } -static apr_status_t serviceTrackerCustomizer_destroy(void *customizerPointer) { - service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) customizerPointer; - +celix_status_t serviceTrackerCustomizer_destroy(service_tracker_customizer_pt customizer) { customizer->handle = NULL; customizer->addingService = NULL; customizer->addedService = NULL; customizer->modifiedService = NULL; customizer->removedService = NULL; - return APR_SUCCESS; + return CELIX_SUCCESS; } celix_status_t serviceTrackerCustomizer_getHandle(service_tracker_customizer_pt customizer, void **handle) { Modified: incubator/celix/trunk/framework/private/src/utils.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/utils.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/utils.c (original) +++ incubator/celix/trunk/framework/private/src/utils.c Sat Jun 7 12:44:31 2014 @@ -25,7 +25,6 @@ */ #include #include -#include #include "utils.h" #include "celix_log.h" @@ -50,9 +49,6 @@ int utils_stringEquals(void * string, vo return strcmp((char *)string, (char *) toCompare) == 0; } -/** - * \deprecated APR provides a correct alternative: apr_pstrndup - */ char * string_ndup(const char *s, size_t n) { size_t len = strlen(s); char *ret; Modified: incubator/celix/trunk/framework/private/src/version.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/version.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/version.c (original) +++ incubator/celix/trunk/framework/private/src/version.c Sat Jun 7 12:44:31 2014 @@ -25,7 +25,7 @@ */ #include #include -#include +#include #include "celix_errno.h" #include "version_private.h" @@ -117,7 +117,7 @@ celix_status_t version_createVersionFrom int i = 0; - token = apr_strtok(versionStr, delims, &last); + token = strtok_r(versionStr, delims, &last); if (token != NULL) { for (i = 0; i < strlen(token); i++) { char ch = token[i]; @@ -129,7 +129,7 @@ celix_status_t version_createVersionFrom break; } major = atoi(token); - token = apr_strtok(NULL, delims, &last); + token = strtok_r(NULL, delims, &last); if (token != NULL) { for (i = 0; i < strlen(token); i++) { char ch = token[i]; @@ -141,7 +141,7 @@ celix_status_t version_createVersionFrom break; } minor = atoi(token); - token = apr_strtok(NULL, delims, &last); + token = strtok_r(NULL, delims, &last); if (token != NULL) { for (i = 0; i < strlen(token); i++) { char ch = token[i]; @@ -153,10 +153,10 @@ celix_status_t version_createVersionFrom break; } micro = atoi(token); - token = apr_strtok(NULL, delims, &last); + token = strtok_r(NULL, delims, &last); if (token != NULL) { qualifier = strdup(token); - token = apr_strtok(NULL, delims, &last); + token = strtok_r(NULL, delims, &last); if (token != NULL) { printf("invalid format"); *version = NULL; Modified: incubator/celix/trunk/framework/private/src/version_range.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/version_range.c?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/src/version_range.c (original) +++ incubator/celix/trunk/framework/private/src/version_range.c Sat Jun 7 12:44:31 2014 @@ -53,7 +53,7 @@ celix_status_t versionRange_destroy(vers range->isHighInclusive = false; range->low = NULL; range->isLowInclusive = false; - return APR_SUCCESS; + return CELIX_SUCCESS; } celix_status_t versionRange_createInfiniteVersionRange(version_range_pt *range) { Modified: incubator/celix/trunk/framework/private/test/attribute_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/attribute_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/attribute_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/attribute_test.cpp Sat Jun 7 12:44:31 2014 @@ -43,18 +43,12 @@ int main(int argc, char** argv) { } TEST_GROUP(attribute) { - 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(); } @@ -65,7 +59,7 @@ TEST(attribute, create) { char value[] = "value"; attribute_pt attribute = NULL; - celix_status_t status = attribute_create(pool, key, value, &attribute); + celix_status_t status = attribute_create(key, value, &attribute); STRCMP_EQUAL(key, attribute->key); STRCMP_EQUAL(value, attribute->value); } @@ -74,7 +68,7 @@ TEST(attribute, getKey) { char key[] = "key"; char value[] = "value"; - attribute_pt attribute = (attribute_pt) apr_palloc(pool, sizeof(*attribute)); + attribute_pt attribute = (attribute_pt) malloc(sizeof(*attribute)); attribute->key = key; attribute->value = value; @@ -87,7 +81,7 @@ TEST(attribute, getValue) { char key[] = "key"; char value[] = "value"; - attribute_pt attribute = (attribute_pt) apr_palloc(pool, sizeof(*attribute)); + attribute_pt attribute = (attribute_pt) malloc(sizeof(*attribute)); attribute->key = key; attribute->value = value; Modified: incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp Sat Jun 7 12:44:31 2014 @@ -33,6 +33,8 @@ extern "C" { #include "bundle_archive.h" + +framework_logger_pt logger; } int main(int argc, char** argv) { @@ -40,15 +42,12 @@ int main(int argc, char** argv) { } TEST_GROUP(bundle_archive) { - apr_pool_t *pool; - void setup(void) { - apr_initialize(); - apr_pool_create(&pool, NULL); + logger = (framework_logger_pt) malloc(sizeof(*logger)); + logger->logFunction = frameworkLogger_log; } void teardown() { - apr_pool_destroy(pool); mock().checkExpectations(); mock().clear(); } Modified: incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp Sat Jun 7 12:44:31 2014 @@ -70,7 +70,7 @@ TEST(bundle_cache, create) { .andReturnValue((char *) NULL); bundle_cache_pt cache = NULL; - celix_status_t status = bundleCache_create(configuration, pool, logger, &cache); + celix_status_t status = bundleCache_create(configuration, logger, &cache); LONGS_EQUAL(CELIX_SUCCESS, status); } @@ -79,7 +79,6 @@ TEST(bundle_cache, deleteTree) { char cacheDir[] = "bundle_cache_test_directory"; char cacheFile[] = "bundle_cache_test_directory/temp"; cache->cacheDir = cacheDir; - cache->mp = pool; apr_dir_make(cacheDir, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool); apr_file_t *file; @@ -95,7 +94,6 @@ TEST(bundle_cache, getArchive) { bundle_cache_pt cache = (bundle_cache_pt) apr_palloc(pool, sizeof(*cache)); char cacheDir[] = "bundle_cache_test_directory"; cache->cacheDir = cacheDir; - cache->mp = pool; char bundle0[] = "bundle_cache_test_directory/bundle0"; char bundle1[] = "bundle_cache_test_directory/bundle1"; @@ -111,7 +109,7 @@ TEST(bundle_cache, getArchive) { .andReturnValue(CELIX_SUCCESS); array_list_pt archives = NULL; - celix_status_t status = bundleCache_getArchives(cache, pool, &archives); + celix_status_t status = bundleCache_getArchives(cache, &archives); LONGS_EQUAL(CELIX_SUCCESS, status); CHECK(archives); @@ -143,6 +141,6 @@ TEST(bundle_cache, createArchive) { .andReturnValue(CELIX_SUCCESS); bundle_archive_pt actual; - bundleCache_createArchive(cache, pool, 1l, location, NULL, &actual); + bundleCache_createArchive(cache, 1l, location, NULL, &actual); POINTERS_EQUAL(archive, actual); } Modified: incubator/celix/trunk/framework/private/test/bundle_context_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/bundle_context_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/bundle_context_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/bundle_context_test.cpp Sat Jun 7 12:44:31 2014 @@ -70,7 +70,7 @@ TEST(bundle_context, create) { .andReturnValue(CELIX_SUCCESS); bundle_context_pt context = NULL; - bundleContext_create(framework, logger, bundle, &context); + bundleContext_create(pool, framework, logger, bundle, &context); POINTERS_EQUAL(framework, context->framework) POINTERS_EQUAL(bundle, context->bundle) CHECK(context->pool); Modified: incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp Sat Jun 7 12:44:31 2014 @@ -43,18 +43,12 @@ int main(int argc, char** argv) { } TEST_GROUP(bundle_revision) { - 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(); } @@ -72,13 +66,12 @@ TEST(bundle_revision, create) { .withParameter("revisionRoot", root) .andReturnValue(CELIX_SUCCESS); mock().expectOneCall("manifest_createFromFile") - .withParameter("pool", pool) .withParameter("filename", "bundle_revision_test/META-INF/MANIFEST.MF") .andOutputParameter("manifest", manifest) .andReturnValue(CELIX_SUCCESS); bundle_revision_pt revision = NULL; - celix_status_t status = bundleRevision_create(pool, logger, root, location, revisionNr, inputFile, &revision); + celix_status_t status = bundleRevision_create(logger, root, location, revisionNr, inputFile, &revision); LONGS_EQUAL(CELIX_SUCCESS, status); LONGS_EQUAL(revisionNr, revision->revisionNr); STRCMP_EQUAL(root, revision->root); @@ -98,13 +91,12 @@ TEST(bundle_revision, createWithInput) { .andReturnValue(CELIX_SUCCESS); mock().expectOneCall("manifest_createFromFile") - .withParameter("pool", pool) .withParameter("filename", "bundle_revision_test/META-INF/MANIFEST.MF") .andOutputParameter("manifest", manifest) .andReturnValue(CELIX_SUCCESS); bundle_revision_pt revision = NULL; - celix_status_t status = bundleRevision_create(pool, logger, root, location, revisionNr, inputFile, &revision); + celix_status_t status = bundleRevision_create(logger, root, location, revisionNr, inputFile, &revision); LONGS_EQUAL(CELIX_SUCCESS, status); LONGS_EQUAL(revisionNr, revision->revisionNr); STRCMP_EQUAL(root, revision->root); @@ -112,7 +104,7 @@ TEST(bundle_revision, createWithInput) { } TEST(bundle_revision, getters) { - bundle_revision_pt revision = (bundle_revision_pt) apr_palloc(pool, sizeof(*revision)); + bundle_revision_pt revision = (bundle_revision_pt) malloc(sizeof(*revision)); char root[] = "bundle_revision_test"; char location[] = "test_bundle.zip"; long revisionNr = 1l; Modified: incubator/celix/trunk/framework/private/test/bundle_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/bundle_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/bundle_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/bundle_test.cpp Sat Jun 7 12:44:31 2014 @@ -79,7 +79,7 @@ TEST(bundle, create) { .withParameter("module", module); bundle_pt actual = NULL; - celix_status_t status = bundle_create(&actual, logger, pool); + celix_status_t status = bundle_create(&actual, logger); LONGS_EQUAL(CELIX_SUCCESS, status); POINTERS_EQUAL(NULL, actual->context); POINTERS_EQUAL(NULL, actual->activator); @@ -88,8 +88,7 @@ TEST(bundle, create) { POINTERS_EQUAL(archive, actual->archive); CHECK(actual->modules); POINTERS_EQUAL(NULL, actual->manifest); - POINTERS_EQUAL(pool, actual->memoryPool); - CHECK(actual->lock) +// CHECK(actual->lock) LONGS_EQUAL(0, actual->lockCount); POINTERS_EQUAL(NULL, actual->lockThread); POINTERS_EQUAL(NULL, actual->framework); @@ -150,7 +149,7 @@ TEST(bundle, createFromArchive) { .withParameter("module", module); bundle_pt actual = NULL; - celix_status_t status = bundle_createFromArchive(&actual, framework, archive, pool); + celix_status_t status = bundle_createFromArchive(&actual, framework, archive); LONGS_EQUAL(CELIX_SUCCESS, status); POINTERS_EQUAL(NULL, actual->context); POINTERS_EQUAL(NULL, actual->activator); @@ -159,8 +158,7 @@ TEST(bundle, createFromArchive) { POINTERS_EQUAL(archive, actual->archive); CHECK(actual->modules); POINTERS_EQUAL(NULL, actual->manifest); - POINTERS_EQUAL(pool, actual->memoryPool); - CHECK(actual->lock) +// CHECK(actual->lock) LONGS_EQUAL(0, actual->lockCount); POINTERS_EQUAL(NULL, actual->lockThread); POINTERS_EQUAL(framework, actual->framework); @@ -278,12 +276,11 @@ TEST(bundle, getEntry) { .withParameter("framework", framework) .withParameter("bundle", bundle) .withParameter("name", name) - .withParameter("pool", pool) .andOutputParameter("entry", expected) .andReturnValue(CELIX_SUCCESS); char *actual = NULL; - celix_status_t status = bundle_getEntry(bundle, name, pool, &actual); + celix_status_t status = bundle_getEntry(bundle, name, &actual); LONGS_EQUAL(CELIX_SUCCESS, status); POINTERS_EQUAL(expected, actual); } @@ -448,7 +445,7 @@ TEST(bundle, revise) { TEST(bundle, isLockable) { bundle_pt bundle = (bundle_pt) apr_palloc(pool, sizeof(*bundle)); - apr_thread_mutex_create(&bundle->lock, APR_THREAD_MUTEX_UNNESTED, pool); + celixThreadMutex_create(&bundle->lock, NULL); bool lockable = false; celix_status_t status = bundle_isLockable(bundle, &lockable); Modified: incubator/celix/trunk/framework/private/test/capability_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/capability_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/capability_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/capability_test.cpp Sat Jun 7 12:44:31 2014 @@ -95,7 +95,7 @@ TEST(capability, create) { .andReturnValue(CELIX_SUCCESS); capability_pt capability = NULL; - celix_status_t status = capability_create(pool, module, directives, attributes, &capability); + celix_status_t status = capability_create(module, directives, attributes, &capability); } TEST(capability, getServiceName) { Modified: incubator/celix/trunk/framework/private/test/filter_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/filter_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/filter_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/filter_test.cpp Sat Jun 7 12:44:31 2014 @@ -25,6 +25,7 @@ */ #include #include +#include #include "CppUTest/TestHarness.h" #include "CppUTest/TestHarness_c.h" @@ -56,7 +57,7 @@ TEST_GROUP(filter) { TEST(filter, create) { char filterStr[] = "(key=value)"; - filter_pt filter = filter_create(filterStr, pool); + filter_pt filter = filter_create(filterStr); STRCMP_EQUAL(filterStr, filter->filterStr); } Modified: incubator/celix/trunk/framework/private/test/manifest_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/manifest_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/manifest_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/manifest_test.cpp Sat Jun 7 12:44:31 2014 @@ -26,6 +26,8 @@ #include #include +#include + #include "CppUTest/TestHarness.h" #include "CppUTest/TestHarness_c.h" #include "CppUTest/CommandLineTestRunner.h" @@ -99,7 +101,7 @@ TEST(manifest, createFromFile) { .expectOneCall("properties_destroy") .withParameter("properties", properties); - manifest_createFromFile(pool, manifestFile, &manifest); + manifest_createFromFile(manifestFile, &manifest); } TEST(manifest, createFromFileWithSections) { @@ -165,7 +167,7 @@ TEST(manifest, createFromFileWithSection .expectOneCall("properties_destroy") .withParameter("properties", properties); - manifest_createFromFile(pool, manifestFile, &manifest); + manifest_createFromFile(manifestFile, &manifest); properties_pt main = manifest_getMainAttributes(manifest); POINTERS_EQUAL(properties, main); Modified: incubator/celix/trunk/framework/private/test/requirement_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/requirement_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/requirement_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/requirement_test.cpp Sat Jun 7 12:44:31 2014 @@ -96,7 +96,7 @@ TEST(requirement, create) { .andReturnValue(CELIX_SUCCESS); requirement_pt requirement = NULL; - requirement_create(pool, directives, attributes, &requirement); + requirement_create(directives, attributes, &requirement); } TEST(requirement, getVersionRange) { Modified: incubator/celix/trunk/framework/private/test/service_reference_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/service_reference_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/service_reference_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/service_reference_test.cpp Sat Jun 7 12:44:31 2014 @@ -65,7 +65,7 @@ TEST(service_reference, create) { service_registration_pt registration = (service_registration_pt) 0x20; service_reference_pt reference = NULL; - serviceReference_create(pool, bundle, registration, &reference); + serviceReference_create(bundle, registration, &reference); POINTERS_EQUAL(bundle, reference->bundle); POINTERS_EQUAL(registration, reference->registration); @@ -125,7 +125,7 @@ TEST(service_reference, getUsingBundle) .andReturnValue(bundles); array_list_pt actual = NULL; - celix_status_t status = serviceReference_getUsingBundles(reference, pool, &actual); + celix_status_t status = serviceReference_getUsingBundles(reference, &actual); POINTERS_EQUAL(bundles, actual); LONGS_EQUAL(1, arrayList_size(actual)); POINTERS_EQUAL(bundle, arrayList_get(actual, 0)); Modified: incubator/celix/trunk/framework/private/test/service_registration_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/service_registration_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/service_registration_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/service_registration_test.cpp Sat Jun 7 12:44:31 2014 @@ -81,7 +81,7 @@ TEST(service_registration, create) { .withParameter("value", "service") .andReturnValue((char *) NULL); - service_registration_pt registration = serviceRegistration_create(pool, registry, bundle, (char *) serviceName.c_str(), serviceId, service, NULL); + service_registration_pt registration = serviceRegistration_create(registry, bundle, (char *) serviceName.c_str(), serviceId, service, NULL); POINTERS_EQUAL(registry, registration->registry); STRCMP_EQUAL("service", registration->className); @@ -91,7 +91,7 @@ TEST(service_registration, create) { POINTERS_EQUAL(properties, registration->properties); POINTERS_EQUAL(service, registration->svcObj); LONGS_EQUAL(serviceId, registration->serviceId); - CHECK(registration->mutex); +// CHECK(registration->mutex); LONGS_EQUAL(0, registration->isUnregistering); LONGS_EQUAL(0, registration->isServiceFactory); POINTERS_EQUAL(NULL, registration->serviceFactory); @@ -120,7 +120,7 @@ TEST(service_registration, createService .withParameter("value", "service") .andReturnValue((char *) NULL); - service_registration_pt registration = serviceRegistration_createServiceFactory(pool, registry, bundle, (char *) serviceName.c_str(), serviceId, service, NULL); + service_registration_pt registration = serviceRegistration_createServiceFactory(registry, bundle, (char *) serviceName.c_str(), serviceId, service, NULL); POINTERS_EQUAL(registry, registration->registry); STRCMP_EQUAL("service", registration->className); @@ -130,7 +130,7 @@ TEST(service_registration, createService POINTERS_EQUAL(properties, registration->properties); POINTERS_EQUAL(service, registration->svcObj); LONGS_EQUAL(serviceId, registration->serviceId); - CHECK(registration->mutex); +// CHECK(registration->mutex); LONGS_EQUAL(0, registration->isUnregistering); LONGS_EQUAL(1, registration->isServiceFactory); POINTERS_EQUAL(service, registration->serviceFactory); @@ -159,7 +159,7 @@ TEST(service_registration, isValidFalse) TEST(service_registration, invalidate) { service_registration_pt registration = (service_registration_pt) apr_palloc(pool, sizeof(*registration)); - apr_thread_mutex_create(®istration->mutex, 0, pool); + celixThreadMutex_create(®istration->mutex, NULL); void *service = (void *) 0x30; registration->svcObj = service; @@ -174,7 +174,7 @@ TEST(service_registration, unregisterVal service_registration_pt registration = (service_registration_pt) apr_palloc(pool, sizeof(*registration)); registration->registry = registry; registration->bundle = bundle; - apr_thread_mutex_create(®istration->mutex, 0, pool); + celixThreadMutex_create(®istration->mutex, NULL); void *service = (void *) 0x30; registration->svcObj = service; @@ -195,7 +195,7 @@ TEST(service_registration, unregisterInv service_registration_pt registration = (service_registration_pt) apr_palloc(pool, sizeof(*registration)); registration->registry = registry; registration->bundle = bundle; - apr_thread_mutex_create(®istration->mutex, 0, pool); + celixThreadMutex_create(®istration->mutex, NULL); registration->svcObj = NULL; celix_status_t status = serviceRegistration_unregister(registration); Modified: incubator/celix/trunk/framework/private/test/service_registry_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/service_registry_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/service_registry_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/service_registry_test.cpp Sat Jun 7 12:44:31 2014 @@ -69,14 +69,14 @@ TEST(service_registry, create) { framework_pt framework = (framework_pt) 0x10; service_registry_pt registry = NULL; - serviceRegistry_create(pool, framework, serviceRegistryTest_serviceChanged, ®istry); + serviceRegistry_create(framework, serviceRegistryTest_serviceChanged, ®istry); POINTERS_EQUAL(framework, registry->framework); POINTERS_EQUAL(serviceRegistryTest_serviceChanged, registry->serviceChanged); LONGS_EQUAL(1l, registry->currentServiceId); CHECK(registry->inUseMap != NULL); CHECK(registry->listenerHooks != NULL); - CHECK(registry->mutex != NULL); + //CHECK(registry->mutex != NULL); CHECK(registry->serviceReferences == NULL); CHECK(registry->serviceRegistrations != NULL); } @@ -131,7 +131,7 @@ TEST(service_registry, getRegisteredServ .andReturnValue(CELIX_SUCCESS); array_list_pt services = NULL; - serviceRegistry_getRegisteredServices(registry, pool, bundle, &services); + serviceRegistry_getRegisteredServices(registry, bundle, &services); LONGS_EQUAL(1, arrayList_size(services)); POINTERS_EQUAL(ref, arrayList_get(services, 0)); } @@ -158,7 +158,9 @@ TEST(service_registry, getServicesInUse) TEST(service_registry, registerServiceNoProps) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -191,7 +193,9 @@ TEST(service_registry, registerServiceNo TEST(service_registry, registerServiceFactoryNoProps) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -224,7 +228,9 @@ TEST(service_registry, registerServiceFa TEST(service_registry, unregisterService) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -276,7 +282,9 @@ TEST(service_registry, unregisterService TEST(service_registry, unregisterServices) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -303,7 +311,9 @@ TEST(service_registry, unregisterService TEST(service_registry, getServiceReferences) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -365,7 +375,7 @@ TEST(service_registry, getServiceReferen .andReturnValue(CELIX_SUCCESS); array_list_pt actual = NULL; - serviceRegistry_getServiceReferences(registry, pool, "test", NULL, &actual); + serviceRegistry_getServiceReferences(registry, "test", NULL, &actual); LONGS_EQUAL(1, arrayList_size(actual)); POINTERS_EQUAL(reference, arrayList_get(actual, 0)); } @@ -373,7 +383,9 @@ TEST(service_registry, getServiceReferen TEST(service_registry, getService) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -428,7 +440,9 @@ TEST(service_registry, getService) { TEST(service_registry, ungetService) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -450,7 +464,6 @@ TEST(service_registry, ungetService) { arrayList_create(&usages); usage_count_pt usage = (usage_count_pt) malloc(sizeof(*usage)); usage->reference = reference; - apr_pool_create(&usage->pool, pool); arrayList_add(usages, usage); hashMap_put(registry->inUseMap, bundle, usages); @@ -472,7 +485,9 @@ TEST(service_registry, ungetService) { TEST(service_registry, ungetServivces) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -495,7 +510,6 @@ TEST(service_registry, ungetServivces) { usage_count_pt usage = (usage_count_pt) malloc(sizeof(*usage)); usage->reference = reference; usage->count = 1; - apr_pool_create(&usage->pool, pool); arrayList_add(usages, usage); hashMap_put(registry->inUseMap, bundle, usages); @@ -531,7 +545,9 @@ TEST(service_registry, ungetServivces) { TEST(service_registry, getUsingBundles) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -556,7 +572,7 @@ TEST(service_registry, getUsingBundles) arrayList_add(usages, usage); hashMap_put(registry->inUseMap, bundle, usages); - array_list_pt actual = serviceRegistry_getUsingBundles(registry, pool, reference); + array_list_pt actual = serviceRegistry_getUsingBundles(registry, reference); LONGS_EQUAL(1, arrayList_size(actual)); POINTERS_EQUAL(bundle, arrayList_get(actual, 0)); } @@ -564,7 +580,9 @@ TEST(service_registry, getUsingBundles) TEST(service_registry, createServiceReference) { service_registry_pt registry = (service_registry_pt) apr_palloc(pool, sizeof(*registry)); registry->inUseMap = hashMap_create(NULL, NULL, NULL, NULL); - apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool); + celixThreadMutexAttr_create(®istry->mutexAttr); + celixThreadMutexAttr_settype(®istry->mutexAttr, CELIX_THREAD_MUTEX_RECURSIVE); + celixThreadMutex_create(®istry->mutex, ®istry->mutexAttr); registry->currentServiceId = 1l; registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL); @@ -611,7 +629,7 @@ TEST(service_registry, createServiceRefe .andReturnValue(CELIX_SUCCESS); service_reference_pt actual = NULL; - serviceRegistry_createServiceReference(registry, pool, registration, &actual); + serviceRegistry_createServiceReference(registry, registration, &actual); POINTERS_EQUAL(reference, actual); } @@ -659,7 +677,7 @@ TEST(service_registry, getListenerHooks) .andReturnValue(CELIX_SUCCESS); array_list_pt hooks = NULL; - celix_status_t status = serviceRegistry_getListenerHooks(registry, pool, &hooks); + celix_status_t status = serviceRegistry_getListenerHooks(registry, &hooks); LONGS_EQUAL(1, arrayList_size(hooks)); POINTERS_EQUAL(reference, arrayList_get(hooks, 0)); } Modified: incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp Sat Jun 7 12:44:31 2014 @@ -81,7 +81,7 @@ extern "C" { TEST(service_tracker_customizer, create) { void *handle = (void *) 0x10; service_tracker_customizer_pt customizer = NULL; - celix_status_t status = serviceTrackerCustomizer_create(pool, + celix_status_t status = serviceTrackerCustomizer_create( handle, serviceTrackerCustomizerTest_addingService, serviceTrackerCustomizerTest_addedService, @@ -99,7 +99,7 @@ TEST(service_tracker_customizer, create) TEST(service_tracker_customizer, createIllegalArgument) { void *handle = (void *) 0x10; service_tracker_customizer_pt customizer = NULL; - celix_status_t status = serviceTrackerCustomizer_create(pool, + celix_status_t status = serviceTrackerCustomizer_create( NULL, serviceTrackerCustomizerTest_addingService, serviceTrackerCustomizerTest_addedService, Modified: incubator/celix/trunk/framework/private/test/service_tracker_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/service_tracker_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/service_tracker_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/service_tracker_test.cpp Sat Jun 7 12:44:31 2014 @@ -67,13 +67,12 @@ TEST(service_tracker, create) { service_tracker_pt tracker = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x123; std::string service = "service"; - status = serviceTracker_create(pool, ctx, (char *) service.c_str(), NULL, &tracker); + status = serviceTracker_create(ctx, (char *) service.c_str(), NULL, &tracker); LONGS_EQUAL(CELIX_SUCCESS, status); POINTERS_EQUAL(ctx, tracker->context); POINTERS_EQUAL(NULL, tracker->customizer); POINTERS_EQUAL(NULL, tracker->listener); - POINTERS_EQUAL(pool, tracker->pool); POINTERS_EQUAL(tracker, tracker->tracker); STRCMP_EQUAL("(objectClass=service)", tracker->filter); } @@ -83,13 +82,12 @@ TEST(service_tracker, createWithFilter) service_tracker_pt tracker = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x123; std::string filter = "(objectClass=test)"; - status = serviceTracker_createWithFilter(pool, ctx, (char *) filter.c_str(), NULL, &tracker); + status = serviceTracker_createWithFilter(ctx, (char *) filter.c_str(), NULL, &tracker); LONGS_EQUAL(CELIX_SUCCESS, status); POINTERS_EQUAL(ctx, tracker->context); POINTERS_EQUAL(NULL, tracker->customizer); POINTERS_EQUAL(NULL, tracker->listener); - POINTERS_EQUAL(pool, tracker->pool); POINTERS_EQUAL(tracker, tracker->tracker); STRCMP_EQUAL("(objectClass=test)", tracker->filter); } @@ -99,7 +97,7 @@ TEST(service_tracker, destroy) { service_tracker_pt tracker = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x123; std::string filter = "(objectClass=test)"; - status = serviceTracker_createWithFilter(pool, ctx, (char *) filter.c_str(), NULL, &tracker); + status = serviceTracker_createWithFilter(ctx, (char *) filter.c_str(), NULL, &tracker); service_listener_pt listener = (service_listener_pt) 0x20; tracker->listener = listener; @@ -114,7 +112,6 @@ TEST(service_tracker, open) { // Without initial services and no customizer // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; std::string filter = "(objectClass=service)"; @@ -152,7 +149,6 @@ TEST(service_tracker, open_withRefs) { // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; tracker->customizer = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; @@ -211,7 +207,6 @@ TEST(service_tracker, open_withRefsAndTr // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; tracker->customizer = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; @@ -475,7 +470,6 @@ TEST(service_tracker, serviceChangedRegi // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; tracker->customizer = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; @@ -506,7 +500,6 @@ TEST(service_tracker, serviceChangedModi // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; tracker->customizer = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; @@ -542,7 +535,6 @@ TEST(service_tracker, serviceChangedUnre // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; tracker->customizer = NULL; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; @@ -584,7 +576,6 @@ TEST(service_tracker, serviceChangedModi // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; service_listener_pt listener = (service_listener_pt) apr_palloc(pool, sizeof(*listener)); @@ -624,7 +615,6 @@ TEST(service_tracker, serviceChangedRegi // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; service_listener_pt listener = (service_listener_pt) apr_palloc(pool, sizeof(*listener)); @@ -679,7 +669,6 @@ TEST(service_tracker, serviceChangedModi // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; service_listener_pt listener = (service_listener_pt) apr_palloc(pool, sizeof(*listener)); @@ -734,7 +723,6 @@ TEST(service_tracker, serviceChangedUnre // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; service_listener_pt listener = (service_listener_pt) apr_palloc(pool, sizeof(*listener)); @@ -783,7 +771,6 @@ TEST(service_tracker, serviceChangedUnre // With one initial service // new tracker service_tracker_pt tracker = (service_tracker_pt) apr_palloc(pool, sizeof(*tracker)); - tracker->pool = pool; bundle_context_pt ctx = (bundle_context_pt) 0x10; tracker->context = ctx; service_listener_pt listener = (service_listener_pt) apr_palloc(pool, sizeof(*listener)); Modified: incubator/celix/trunk/framework/private/test/version_range_test.cpp URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/version_range_test.cpp?rev=1601103&r1=1601102&r2=1601103&view=diff ============================================================================== --- incubator/celix/trunk/framework/private/test/version_range_test.cpp (original) +++ incubator/celix/trunk/framework/private/test/version_range_test.cpp Sat Jun 7 12:44:31 2014 @@ -42,9 +42,8 @@ extern "C" framework_logger_pt logger; - celix_status_t version_createEmptyVersion(apr_pool_t *pool, version_pt *version) { + celix_status_t version_createEmptyVersion(version_pt *version) { mock_c()->actualCall("version_createEmptyVersion") - ->withPointerParameters("pool", pool) ->_andPointerOutputParameters("version", (void **) version); return CELIX_SUCCESS; } @@ -58,9 +57,8 @@ extern "C" return CELIX_SUCCESS; } - celix_status_t version_createVersionFromString(apr_pool_t *pool, char * versionStr, version_pt *version) { + celix_status_t version_createVersionFromString(char * versionStr, version_pt *version) { mock_c()->actualCall("version_createVersionFromString") - ->withPointerParameters("pool", pool) ->withStringParameters("versionStr", versionStr) ->_andPointerOutputParameters("version", (void **) version); return CELIX_SUCCESS; @@ -95,7 +93,7 @@ TEST(version_range, create) { version_range_pt range = NULL; version_pt version = (version_pt) apr_palloc(pool, sizeof(*version)); - status = versionRange_createVersionRange(pool, version, false, version, true, &range); + status = versionRange_createVersionRange(version, false, version, true, &range); LONGS_EQUAL(CELIX_SUCCESS, status); CHECK_C((range != NULL)); LONGS_EQUAL(true, range->isHighInclusive); @@ -116,7 +114,7 @@ TEST(version_range, createInfinite) { .expectOneCall("version_createEmptyVersion") .withParameter("pool", pool) .andOutputParameter("version", version); - status = versionRange_createInfiniteVersionRange(pool, &range); + status = versionRange_createInfiniteVersionRange(&range); LONGS_EQUAL(CELIX_SUCCESS, status); CHECK_C(range != NULL); LONGS_EQUAL(true, range->isHighInclusive); @@ -143,7 +141,7 @@ TEST(version_range, isInRange) { high->minor = 2; high->micro = 3; - versionRange_createVersionRange(pool, low, true, high, true, &range); + versionRange_createVersionRange(low, true, high, true, &range); mock() .expectOneCall("version_compareTo") @@ -189,7 +187,7 @@ TEST(version_range, parse) { .andOutputParameter("version", high); std::string version = "[1.2.3, 7.8.9]"; - status = versionRange_parse(pool, (char *) version.c_str(), &range); + status = versionRange_parse((char *) version.c_str(), &range); LONGS_EQUAL(CELIX_SUCCESS, status); }