eclipse-score / eclipse-score/communication
mw:com: Revisit usage of static counter increment in my_bounded_memory_resource.h
- Dominant language
- C++
- Stars
- 62
- Forks
- 97
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 72
Description
### What
Background:
While adding new tests for proxy method handling, it was found that that some new tests could cause existing ones to fail because of MemoryResourceIdentifier collisions in the registry map. The fake bounded memory resource uses a static counter that increments every time a new fake memory resource is created, but FakeMockedServiceData was still using hardcoded IDs 10 and 11. Once the counter reached those values, both paths tried to register the same IDs, which triggered the test failures.
As a short term fix, these hardcoded IDs were bumped to take max values in this [PR](https://github.com/eclipse-score/communication/pull/534)
This ticket is create so we can come up with a robust fix.
### How
Re-evaluate the usage of static counters and design an API with which user can inject the ID directly.
### Estimates for realization
TBD
### Category
- [ ] Affects Detailed Design
### Requirements / Architecture
- [x] Requirements / Architecture are not affected by this change?
Contributor guide
Assessment
This issue has not been assessed yet.