Changeset 7ba2ad4 for tester.c


Ignore:
Timestamp:
Sep 18, 2010, 3:17:27 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
b3b1b05
Parents:
4cf7b1b
git-author:
David Benjamin <davidben@mit.edu> (07/31/10 20:30:49)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 15:17:27)
Message:
Implement owl_fmtext_line_extents and add test case
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    rdc9665a r7ba2ad4  
    434434int owl_fmtext_regtest(void) {
    435435  int numfailed = 0;
     436  int start, end;
    436437  owl_fmtext fm1;
    437438  owl_fmtext fm2;
     
    557558  owl_regex_cleanup(&re);
    558559
     560  /* Test owl_fmtext_line_extents. */
     561  owl_fmtext_clear(&fm1);
     562  owl_fmtext_append_normal(&fm1, "123\n456\n789");
     563  owl_fmtext_line_extents(&fm1, 1, &start, &end);
     564  FAIL_UNLESS("line contents",
     565              !strncmp("456\n", owl_fmtext_get_text(&fm1)+start, end-start));
     566  owl_fmtext_line_extents(&fm1, 2, &start, &end);
     567  FAIL_UNLESS("point to end of buffer", end == owl_fmtext_num_bytes(&fm1));
     568
    559569  owl_fmtext_cleanup(&fm1);
    560570  owl_fmtext_cleanup(&fm2);
Note: See TracChangeset for help on using the changeset viewer.