test-set.c revision bdf7026e9557349cd3eeb291c01655d5f2a55db8
/***
This file is part of systemd
Copyright 2014 Zbigniew Jędrzejewski-Szmek
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "util.h"
#include "set.h"
static void test_set_steal_first(void) {
int seen[3] = {};
char *val;
m = set_new(&string_hash_ops);
assert_se(m);
while ((val = set_steal_first(m)))
assert_se(set_isempty(m));
}
return 0;
}