Пример #1
0
/* Illustrates the same bug as doctests/hyphenate_xxx_test.txt
 * The same bug can be reproduced with only 3 'x'es. */
int main(int argc, char **argv)
{
    int ret = 0;
    char *tables = "tables/cs-g1.ctb,tables/hyph_cs_CZ.dic";
    char *word = "xxx";
    char * hyphens = calloc(5, sizeof(char));

    hyphens[0] = '0';
    hyphens[1] = '0';
    hyphens[2] = '0';

    ret = check_hyphenation(tables, word, hyphens);
    assert(hyphens[3] == '\0');
    assert(hyphens[4] == '\0');
    free(hyphens);
    lou_free();
    return ret;
}
Пример #2
0
int main(int argc, char **argv)
{
  int ret = 0;
  char *tables = "da-dk-g26.ctb";
  char *word = "achena";
  char * hyphens = calloc(8, sizeof(char));

  hyphens[0] = '0';
  hyphens[1] = '1';
  hyphens[2] = '0';
  hyphens[3] = '0';
  hyphens[4] = '1';
  hyphens[5] = '0';

  ret = check_hyphenation(tables, word, hyphens);
  assert(hyphens[6] == '\0');
  assert(hyphens[7] == '\0');
  free(hyphens);
  return ret;
}