~ubuntu-branches/ubuntu/gutsy/pkg-create-dbgsym/gutsy-updates

« back to all changes in this revision

Viewing changes to tests/dhtest.dbg2/crash2.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-03 10:58:17 UTC
  • Revision ID: james.westby@ubuntu.com-20070403105817-8gr6x57jupwe4ve8
Tags: 0.20
* Move test suite into tests/ to unclutter source root directory.
* Add tests/dhtest.versionoverride: Test case for overriding the version of
  a particular binary. This replicates LP #92747. However, since this is
  unfixable without major changes (dh_strip is called before dh_gencontrol
  usually), we do not run the test case for now.
* pkg_create_dbgsym: Do not generate conflicts to python dbg packages.
  (LP: #88695)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* crash.c - demo program for libcrashreport
 
2
 
 
3
   (c) 2004 Martin Pitt <martin@piware.de>
 
4
 
 
5
   This file is public domain.
 
6
*/
 
7
 
 
8
#include <stdio.h>
 
9
#include <math.h>
 
10
#include <signal.h>
 
11
 
 
12
double h()
 
13
{
 
14
    double a = 1./0;
 
15
    if (isinf(a))
 
16
        raise(SIGFPE);
 
17
    return a;
 
18
}
 
19
 
 
20
int g( int x, int y )
 
21
{
 
22
    
 
23
    return x+y+(int) h();
 
24
}
 
25
 
 
26
int f( int x )
 
27
{
 
28
    return g( x, 42 );
 
29
}
 
30
 
 
31
int
 
32
main()
 
33
{
 
34
    int x;
 
35
 
 
36
    x = f(1);
 
37
    printf( "x = %i, terminating normally now.\n", x );
 
38
    return 0;
 
39
}