jiridanek commented on pull request #880:
URL: https://github.com/apache/qpid-dispatch/pull/880#issuecomment-716464637


   @nicob87 Idea is probably good, but the implementation may not be ideal, yet.
   
   Setup for this kind of a test takes about 80 ms, because it starts most of 
the router, and initializes Python. That may be too slow to initialize new 
router for every single test. But the point of all this is to have isolated 
tests.
   
   I am not sure how much of C++ features I should be using. It can simplify 
things, but it is a different language than C, with all the problems that come 
from that. The uniqe_ptr with deleters looks really nice, if it can be wrapped 
in something less verbose than what's in the code fragment below. Creating fake 
messages would also be much easier with a C++ wrapper over the C API.
   
   Doing some of the setup  is lengthy and it somewhat duplicates the 
production code. Meaning it would complicate keeping tests in sync with 
production code. See for example what it looks like if I want to initialize 
`qdr_link_t` myself,
   
   
https://github.com/apache/qpid-dispatch/pull/880/files#diff-da66f2598384728900547ac702d364f6df8b8253fb86d607bfc6be369494e5dfR225-R228
   
   Doing it through `qdr_create_link_CT` would of course make things simpler; 
maybe that is the right way to go.
   
   Some things cannot be even initialized directly, because there are opaque C 
structs. In a different type of a test (where I'd include specific C files I 
need, and not the whole dispatch so library, I could include the needed C 
files... This can be solved by using the `_private.h` convention more, so it's 
probably not a problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to