~ubuntu-branches/ubuntu/utopic/gettext/utopic

« back to all changes in this revision

Viewing changes to gettext-tools/gnulib-tests/test-open.c

  • Committer: Colin Watson
  • Date: 2010-08-01 21:36:08 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: cjwatson@canonical.com-20100801213608-yy7vkm8lpatep3ci
merge from Debian 0.18.1.1-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Test of opening a file descriptor.
2
 
   Copyright (C) 2007 Free Software Foundation, Inc.
 
2
   Copyright (C) 2007-2010 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
20
20
 
21
21
#include <fcntl.h>
22
22
 
 
23
#include "signature.h"
 
24
SIGNATURE_CHECK (open, int, (char const *, int, ...));
 
25
 
 
26
#include <errno.h>
 
27
#include <stdbool.h>
23
28
#include <stdio.h>
24
 
#include <stdlib.h>
25
 
 
26
 
#define ASSERT(expr) \
27
 
  do                                                                         \
28
 
    {                                                                        \
29
 
      if (!(expr))                                                           \
30
 
        {                                                                    \
31
 
          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
32
 
          abort ();                                                          \
33
 
        }                                                                    \
34
 
    }                                                                        \
35
 
  while (0)
 
29
#include <unistd.h>
 
30
 
 
31
#include "macros.h"
 
32
 
 
33
#define BASE "test-open.t"
 
34
 
 
35
#include "test-open.h"
36
36
 
37
37
int
38
 
main ()
 
38
main (void)
39
39
{
40
 
  ASSERT (open ("/dev/null", O_RDONLY) >= 0);
41
 
 
42
 
  return 0;
 
40
  return test_open (open, true);
43
41
}