diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-05 20:53:01 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-05 20:53:01 +0100 |
commit | ffb6cc32084fcdc1be320e04f704d0db5bd3c014 (patch) | |
tree | efc4cc9ca6aa26139c926421b2fa34e61d6bf858 | |
parent | dc779b51799fcbc431a94ee5a814b6f86f8069ed (diff) | |
download | weechat-ffb6cc32084fcdc1be320e04f704d0db5bd3c014.zip |
tests: add tests on function irc_server_valid
-rw-r--r-- | tests/unit/plugins/irc/test-irc-server.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/plugins/irc/test-irc-server.cpp b/tests/unit/plugins/irc/test-irc-server.cpp index 0a411a703..d187b252d 100644 --- a/tests/unit/plugins/irc/test-irc-server.cpp +++ b/tests/unit/plugins/irc/test-irc-server.cpp @@ -46,7 +46,17 @@ TEST_GROUP(IrcServer) TEST(IrcServer, Valid) { - /* TODO: write tests */ + struct t_irc_server *server; + + server = irc_server_alloc ("server1"); + + LONGS_EQUAL(0, irc_server_valid (NULL)); + LONGS_EQUAL(0, irc_server_valid ((struct t_irc_server *)0x1)); + LONGS_EQUAL(0, irc_server_valid (server + 1)); + + LONGS_EQUAL(1, irc_server_valid (server)); + + irc_server_free (server); } /* |