Long names now fail earlier and require a different test.
---
unit/test-genl.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/unit/test-genl.c b/unit/test-genl.c
index db6d917..a381e25 100644
--- a/unit/test-genl.c
+++ b/unit/test-genl.c
@@ -92,7 +92,7 @@ static bool prep_family_vanished(struct l_genl *genl,
* Use a bogus family name to trigger the vanished watch to
* be called during the ELL event loop run.
*/
- static const char BOGUS_GENL_NAME[] = "bogus_genl_family";
+ static const char BOGUS_GENL_NAME[] = "bogusgenlfamily";
data->vanished_family = l_genl_family_new(genl, BOGUS_GENL_NAME);
return l_genl_family_set_watches(data->vanished_family,
@@ -100,6 +100,15 @@ static bool prep_family_vanished(struct l_genl *genl,
data, NULL);
}
+static bool name_too_long(struct l_genl *genl, struct test_data *data)
+{
+ static const char LONG_GENL_NAME[] = "long_genl_family_name";
+
+ assert(!l_genl_family_new(genl, LONG_GENL_NAME));
+
+ return true;
+}
+
static bool check_test_data(struct test_data *data)
{
return data->group_id != 0 && data->vanished_called;
@@ -154,6 +163,8 @@ int main(int argc, char *argv[])
assert(prep_family_appeared(genl, &data));
assert(prep_family_vanished(genl, &data));
+ assert(name_too_long(genl, &data));
+
idle = l_idle_create(idle_callback, &data, NULL);
l_main_run();
--
2.14.1