25 #include <CUnit/CUnit.h> 28 #include "nomos_gap.h" 41 buf=g_strdup_printf(
"\377abc\377\377de\377\377fg\377hi");
45 for(
int i=0; i<po->len; ++i) {
47 CU_ASSERT_EQUAL(*(buf+thePoA->pos), *(fer+thePoA->pos+thePoA->off));
49 g_array_free(po,TRUE);
65 buf=g_strdup_printf(
"\377abc\377\377de\377\377fg\377hi");
69 for(
int i=0; i< strlen(buf); i++){
70 CU_ASSERT_EQUAL( *(buf+i) , *(fer + uncollapsePosition(i,po)) );
72 g_array_free(po,TRUE);
88 buf=g_strdup_printf(
" abc d e fghi");
91 for(
int i=0; i<po->len; ++i) {
93 CU_ASSERT_EQUAL(*(buf+thePoA->pos), *(fer+thePoA->pos+thePoA->off));
95 g_array_free(po,TRUE);
111 buf=g_strdup_printf(
" abc d e fghi");
114 for(
int i=0; i< strlen(buf); i++){
115 CU_ASSERT_EQUAL( *(buf+i) , *(fer + uncollapsePosition(i,po)) );
117 g_array_free(po,TRUE);
122 CU_TestInfo nomos_gap_testcases[] = {
GArray * collapseInvisible(char *text, char invisible)
void test_collapseSpaces()
Test for collapseSpaces()
void test_uncollapseInvisible()
Test for uncollapsePosition() on collapseInvisible()
void test_uncollapseSpaces()
Test for uncollapsePosition() on collapseSpaces()
void test_collapseInvisible()
Test for collapseInvisible()
GArray * collapseSpaces(char *text)