Mercurial > dovecot > core-2.2
view src/lib/test-str-table.c @ 22656:1789bf2a1e01
director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0
The reset command would just hang in that case. doveadm would never have
sent this, so this is just an extra sanity check.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sun, 05 Nov 2017 23:51:56 +0200 |
parents | 2e2563132d5f |
children | cb108f786fb4 |
line wrap: on
line source
/* Copyright (c) 2014-2017 Dovecot authors, see the included COPYING file */ #include "test-lib.h" #include "str-table.h" void test_str_table(void) { struct str_table *table; const char *key1, *key2, *key1_copy, *key2_copy; test_begin("str_table"); table = str_table_init(); key1 = str_table_ref(table, "str1"); key2 = str_table_ref(table, "str2"); test_assert(key1 != key2); key1_copy = str_table_ref(table, "str1"); test_assert(key1_copy == key1); key2_copy = str_table_ref(table, "str2"); test_assert(key2_copy == key2); str_table_unref(table, &key1); test_assert(key1 == NULL); str_table_unref(table, &key1_copy); str_table_unref(table, &key2); str_table_unref(table, &key2_copy); test_assert(str_table_is_empty(table)); str_table_deinit(&table); test_assert(table == NULL); test_end(); }