~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to lib/gl/tests/test-func.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Test whether __func__ is available
2
 
   Copyright (C) 2008-2009 Free Software Foundation, Inc.
 
2
   Copyright (C) 2008-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
19
19
#include <config.h>
20
20
 
21
21
#include <string.h>
22
 
#include <stdio.h>
23
 
#include <stdlib.h>
24
22
 
25
 
#define ASSERT(expr)                                                         \
26
 
  do                                                                         \
27
 
    {                                                                        \
28
 
      if (!(expr))                                                           \
29
 
        {                                                                    \
30
 
          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
31
 
          fflush (stderr);                                                   \
32
 
          abort ();                                                          \
33
 
        }                                                                    \
34
 
    }                                                                        \
35
 
  while (0)
 
23
#include "macros.h"
36
24
 
37
25
int
38
26
main ()
45
33
  ASSERT (strlen (__func__) + 1 == sizeof __func__);
46
34
#endif
47
35
 
 
36
  ASSERT (strcmp (__func__, "main") == 0
 
37
          || strcmp (__func__, "<unknown function>") == 0);
 
38
 
48
39
  return 0;
49
40
}