Hi Marcel, >> -#include >> +#include >> +#include >> +#include > I rather not include nl80211.h from ELL. Ok, so redefining the constants should be the way. >> #include >> +#include >> >> -static void do_debug(const char *str, void *user_data) >> -{ >> - const char *prefix = user_data; >> +struct key_builder { >> + uint32_t index; >> + uint8_t key_index; >> + uint8_t mac[ETH_ALEN]; >> + const char *tk; >> + size_t tk_len; >> + const char *rsc; >> + size_t rsc_len; >> + uint32_t cipher; >> + bool multicast; >> + const char *verification; >> + uint32_t verification_len; >> +}; > I would really prefer if we are building generic tests data structures that can be used here for adding many (read 20+) test cases instead of some copied over from iwd. > > Unit tests should be generic and excerise every possible functionality. That way you can ensure that code works and keep ensuring that nobody accidentally broke it. > > I mean you have unit/test-dbus-message.c as an example here. It has functions to build the message and a data structure to compare it again. That seems to work pretty well so far. Why not do the same. Ok >> +int main(int argc, char *argv[]) >> +{ >> + l_test_init(&argc, &argv); >> >> - l_genl_unref(genl); >> + l_test_add("nested msg", test_genl_msg_builder, &nl80211_nested_key); >> + l_test_add("normal msg", test_genl_msg_builder, &nl80211_key); >> >> - return 0; >> + return l_test_run(); >> } > I really do not understand why you had to rewrite my test tool here and take the existing functionality out. There is no mentioning anywhere that this can no longer be done. And if you would have followed the D-Bus examples in ELL, then this looks more fitting with a new unit test like unit/test-genl-msg.c or similar anyway. Ok, I'll let test-genl.c alone. Looks like Denis did the test-genl-msg.c so I push the builder thing there. Tomasz