source: trunk/kLdr/testcase/tst-3.c@ 2965

Last change on this file since 2965 was 2965, checked in by bird, 19 years ago

messing about...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/* $Id: tst-3.c 2965 2007-02-13 21:04:40Z bird $ */
2/** @file
3 *
4 * kLdr - Dynamic Loader testcase no. 3, Driver.
5 *
6 * Copyright (c) 2006 knut st. osmundsen <bird-kbuild-src@anduin.net>
7 *
8 *
9 * This file is part of kLdr.
10 *
11 * kLdr is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * kLdr is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with kLdr; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27
28#include "tst.h"
29
30
31int g_i1 = 1;
32int g_i2 = 2;
33int *g_pi1 = &g_i1;
34
35int Tst3Sub(int);
36int (*g_pfnTst3Sub)(int) = &Tst3Sub;
37
38char g_achBss[256];
39
40
41MY_EXPORT(int) Tst3(int iFortyTwo)
42{
43 int rc;
44
45 if (iFortyTwo != 42)
46 return 0;
47 if (g_i1 != 1)
48 return 1;
49 if (g_i2 != 2)
50 return 2;
51 if (g_pi1 != &g_i1)
52 return 3;
53 if (g_pfnTst3Sub != &Tst3Sub)
54 return 4;
55 rc = Tst3Sub(iFortyTwo);
56 if (rc != g_pfnTst3Sub(iFortyTwo))
57 return 5;
58 for (rc = 0; rc < sizeof(g_achBss); rc++)
59 if (g_achBss[rc])
60 return 6;
61 if (g_achBss[0] || g_achBss[1] || g_achBss[255])
62 return 7;
63
64 return 42;
65}
66
67
68int Tst3Sub(int iFortyTwo)
69{
70 return iFortyTwo * 11;
71}
72
Note: See TracBrowser for help on using the repository browser.