16 #include "CUnit/Basic.h"
31 CU_ASSERT_STRING_EQUAL(
"hello world", str);
45 CU_ASSERT_STRING_EQUAL(
"hello 14th world", str);
59 CU_pSuite suite = CU_add_suite(
"stringbuffer", NULL, NULL);
static void test_stringbuffer_append(void)
void stringbuffer_suite_setup(void)
static void test_stringbuffer_aprintf(void)
#define PG_ADD_TEST(suite, testfunc)
stringbuffer_t * stringbuffer_create_with_size(size_t size)
Allocate a new stringbuffer_t.
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
const char * stringbuffer_getstring(stringbuffer_t *s)
Returns a reference to the internal string being managed by the stringbuffer.