~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to cord/cordtest.c

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Murray
  • Date: 2005-02-03 00:50:53 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050203005053-cx2mx04n2zhv58dp
Tags: 1:6.4-1
New upstream release (closes: #292708)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 * modified is included with the above copyright notice.
12
12
 */
13
13
/* Boehm, August 24, 1994 11:58 am PDT */
 
14
# include "gc.h"        /* For GC_INIT() only */
14
15
# include "cord.h"
15
16
# include <string.h>
16
17
# include <stdio.h>
116
117
 
117
118
void test_extras()
118
119
{
119
 
#   if defined(__OS2__)
 
120
#   if defined(__OS2__) || defined(__DJGPP__)
120
121
#       define FNAME1 "tmp1"
121
122
#       define FNAME2 "tmp2"
122
123
#   elif defined(AMIGA)
162
163
        x = CORD_cat(x,x);
163
164
    }
164
165
    if ((f = fopen(FNAME2, "w")) == 0) ABORT("2nd open failed");
 
166
#   ifdef __DJGPP__
 
167
      /* FIXME: DJGPP workaround.  Why does this help? */
 
168
      if (fflush(f) != 0) ABORT("fflush failed");
 
169
#   endif
165
170
    if (CORD_put(x,f) == EOF) ABORT("CORD_put failed");
166
171
    if (fclose(f) == EOF) ABORT("fclose failed");
167
172
    w = CORD_from_file(f2 = fopen(FNAME2, "rb"));
216
221
    if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
217
222
}
218
223
 
219
 
main()
 
224
int main()
220
225
{
221
226
#   ifdef THINK_C
222
227
        printf("cordtest:\n");
223
228
#   endif
 
229
    GC_INIT();
224
230
    test_basics();
225
231
    test_extras();
226
232
    test_printf();