-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/509 remove cpputests #711
Conversation
Also refactor shell tui history to use array list instead of linked list.
Also improves error handling
# Conflicts: # .github/workflows/coverity-scan.yml # .github/workflows/macos.yml # .github/workflows/ubuntu.yml # bundles/pubsub/examples/pubsub/pubsub_websocket/private/include/pubsub_websocket_private.h # bundles/pubsub/examples/pubsub/pubsub_websocket/private/src/ps_websocket_activator.c # bundles/pubsub/examples/pubsub/pubsub_websocket/private/src/pubsub_websocket_example.c # bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_handler.c # bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_admin.c # bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_receiver.c # bundles/pubsub/pubsub_discovery/src/pubsub_discovery_impl.c # bundles/pubsub/pubsub_utils/src/pubsub_utils.c
Also fix invalid array create in dm_dependency_manager_impl.c and add missing status initialize in service_registry.c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this PR can be merged without bringing about any new issues except for some incorrect indentations.
That is, all remarks I gave above apply to existing issues.
But I do want to have a brief discussion about them before the actual merge happens.
I saw lots of arrayList
replaced by celix_arrayList
, but only saw very few #include "celix_array_list.h"
, which suggests that we depend heavily on "transtive includes". Transtive includes often increase accidental complexities. Removing an include from a public header file may break a lot of downstream builds, thus lead to unhappy users. I suggest we follow John Lakos' advice to forbid transtive includes "except to access a public base class of a type whose definition is included directly".
The current ip_utils
is not very satisfatctory. In addition to the drawbacks mentioned below, the current implementation lacks support for ipv6. Considering IPv6 link-local address combined with Bonjour provides real zero configuration networking experience, IPv6 support is critical for IOT devices.
@@ -55,6 +55,6 @@ celix_status_t endpointDiscoveryPoller_destroy(endpoint_discovery_poller_t *poll | |||
celix_status_t endpointDiscoveryPoller_addDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url); | |||
celix_status_t endpointDiscoveryPoller_removeDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url); | |||
|
|||
celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, array_list_pt urls); | |||
celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, celix_array_list_t* urls); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing #include "celix_array_list.h"
.
bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
Outdated
Show resolved
Hide resolved
bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
Outdated
Show resolved
Hide resolved
bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
Outdated
Show resolved
Hide resolved
bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
Outdated
Show resolved
Hide resolved
Good point, then I will remove the ip utils in this branch. If this is needed again the ip utils in commit id |
Also a good point. I do think this is more relevant for C++ code then for C code, but non the less also good to do for our C code. For a C object, the following header guideline should be followed:
I also think this should be addressed in a separate ticket, if you agree I will make a ticket for this. |
Yes, we can address this later. |
# Conflicts: # CHANGES.md
# Conflicts: # CHANGES.md # bundles/remote_services/rsa_spi/include/endpoint_description.h # bundles/remote_services/rsa_spi/include/endpoint_listener.h # libs/framework/include/celix_api.h # libs/framework/include_deprecated/bundle_context.h # libs/framework/include_deprecated/dm_component.h # libs/framework/src/service_registry.c # libs/utils/include_deprecated/celix_utils_api.h
Created #715 for this |
Intro
This PR removes the usage of Cpputest. Cpputest was used for the deprecated linked list, array_list tests, hash map, and IP utils.
Linked List
This PR removes the linked list implementation and the linked list Cpputests. Linked list was still used in the shell TUI history, which has now been refactored to use the array list instead.
Deprecated Array List
The header, implementation, and Cpputests for the deprecated array list API (API without the
celix_
prefix) have been removed. Additionally, any usage of the deprecated array list API has been updated to use celix_array_list. Note that the removal of the deprecated array list usage accounts for the majority of the changed files.IP Utils
The Cpputests for IP utils and their implementation have been refactored to GTests with an updated implementation. This includes enhanced error handling and corresponding tests. It's important to note that IP utils are currently not used in the Celix framework or bundles. However, they could be valuable for remote service implementations, specifically the
celix_utils_findIpInSubnet
function, which can identify the appropriate IP for listening based on a subnet CIDR notation.Deprecated Hash Map
The Cpputests for the deprecated hash map (hash map API without the
celix_
prefix) have been refactored to GTests and are maintained as much as possible in their original form.