]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
text: add a very simple test to ensure open_text works
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 3 Nov 2021 13:42:30 +0000 (14:42 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 3 Nov 2021 13:42:30 +0000 (14:42 +0100)
tests/mlmmj.c

index 43b6821466633839c598760375fe3c76224fb856..19efff2a8d5142b4b2ba26f8eb56c7f43b1dbe56 100644 (file)
 #include "mlmmj.h"
 #include "wrappers.h"
 #include "controls.h"
+#include "prepstdreply.h"
 
 ATF_TC(random_int);
 ATF_TC(statctrl);
 ATF_TC(mlmmj_list);
+ATF_TC(open_text);
 
 ATF_TC_HEAD(random_int, tc) { }
 ATF_TC_HEAD(statctrl, tc) { }
 ATF_TC_HEAD(mlmmj_list, tc) { }
+ATF_TC_HEAD(open_text, tc) {}
 
 #ifndef NELEM
 #define NELEM(array)    (sizeof(array) / sizeof((array)[0]))
@@ -165,10 +168,23 @@ ATF_TC_BODY(mlmmj_list, tc)
        fclose(f);
 }
 
+ATF_TC_BODY(open_text, tc)
+{
+       struct mlmmj_list list;
+
+       init_ml(true);
+       mlmmj_list_init(&list);
+       list.dir = "list";
+       ATF_CHECK(mlmmj_list_open(&list));
+       text *txt = open_text(&list, "finish", "sub", "request", "normal", "sub-confirm");
+       ATF_CHECK(txt != NULL);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
        ATF_TP_ADD_TC(tp, random_int);
        ATF_TP_ADD_TC(tp, mlmmj_list);
        ATF_TP_ADD_TC(tp, statctrl);
+       ATF_TP_ADD_TC(tp, open_text);
        return (atf_no_error());
 }