test-strbuf.c revision 97b5f608182773d7ef9ca18913085b3a3eccd943
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Thomas H.P. Andersen
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 <stdlib.h>
#include <string.h>
#include "strbuf.h"
#include "strv.h"
#include "util.h"
}
static void test_strbuf(void) {
_cleanup_strv_free_ char **l;
ssize_t a, b, c, d, e, f, g;
sb = strbuf_new();
/* check the content of the buffer directly */
/* check the returned offsets and the respective content in the buffer */
assert(a == 1);
assert(b == 7);
assert(c == 11);
assert(d == 1);
assert(e == 2);
assert(f == 4);
assert(g == 15);
}
{
test_strbuf();
return 0;
}