Add simple test for strbuf

Need more

SVN revision: 46024
This commit is contained in:
Sebastian Dransfeld 2010-02-09 21:05:47 +00:00
parent d8d808d161
commit 3d6a752111
4 changed files with 55 additions and 1 deletions

View File

@ -60,7 +60,8 @@ eina_test_mempool.c \
eina_test_rectangle.c \
eina_test_list.c \
eina_test_matrixsparse.c \
eina_test_tiler.c
eina_test_tiler.c \
eina_test_strbuf.c
eina_suite_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libeina.la

View File

@ -55,6 +55,7 @@ static const Eina_Test_Case etc[] = {
{ "Rectangle", eina_test_rectangle },
{ "Matrix Sparse", eina_test_matrixsparse },
{ "Eina Tiler", eina_test_tiler },
{ "Eina Strbuf", eina_test_strbuf },
{ NULL, NULL }
};

View File

@ -43,5 +43,6 @@ void eina_test_mempool(TCase *tc);
void eina_test_rectangle(TCase *tc);
void eina_test_matrixsparse(TCase *tc);
void eina_test_tiler(TCase *tc);
void eina_test_strbuf(TCase *tc);
#endif /* EINA_SUITE_H_ */

View File

@ -0,0 +1,51 @@
/* EINA - EFL data type library
* Copyright (C) 2010 Sebastian Dransfeld
*
* This library is free software; you can redistribute it and/or
* modify it 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.
*
* This library 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 this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include "eina_suite.h"
#include "Eina.h"
START_TEST(eina_strbuf_simple)
{
Eina_Strbuf *buf;
char text[] = "This test should be so long that it is longer than the initial size of strbuf";
eina_init();
buf = eina_strbuf_new();
fail_if(!buf);
eina_strbuf_append(buf, text);
fail_if(strcmp(eina_strbuf_string_get(buf), text));
eina_strbuf_free(buf);
eina_shutdown();
}
END_TEST
void
eina_test_strbuf(TCase *tc)
{
tcase_add_test(tc, eina_strbuf_simple);
}