globals cosmetics, CONST variant
[mala.git] / tests / test-mala_arithmodule.c
blob9661277209fdb525b1d6c6b23929fb78837bb42f
1 /*
2 test-mala_arithmodule.c - MaLa arithmetic module test suite
4 Copyright (C) 2004, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
19 #include <hackerlab/bugs/panic.h>
20 #include <hackerlab/vu/safe-printfmt.h>
21 #include <hackerlab/os/stdlib.h>
22 #include <mala-hackerlab/mala-hackerlab.h>
23 #include <mala-hackerlab/std/std.h>
24 #include <mala-hackerlab/arith/arith.h>
26 int init_mala(MalaEngine eng)
28 int err;
29 if ( err = mala_stdmodule_init(eng))
30 return err;
31 if ( err = mala_arithmodule_init(eng))
32 return err;
34 return 0;
37 int
38 main(int argc, char * argv[])
40 MalaEngine my_engine;
41 my_engine = mala_engine_new_main (init_mala, argc, argv, 0);
43 invariant (mala_engine_getstate (my_engine) == MALA_SUCCESS);
45 mala_engine_run (my_engine);
47 mala_engine_dumpargs (my_engine, stdout, "arg: ", "\n");
48 mala_engine_dumpprogram (my_engine, stdout, "prg: ", "\n");
50 safe_printfmt (1, "variable: %s\n", getenv ("variable"));
51 safe_printfmt (1, "negated: %d\n", mala_engine_is_negated (my_engine));
52 safe_printfmt (1, "state: %d\n", mala_engine_getstate (my_engine));
53 mala_engine_destroy (my_engine);
54 return 0;
61 // Local Variables:
62 // mode: C
63 // c-file-style: "gnu"
64 // End:
65 // arch-tag: fc8f81f4-d22d-4894-a553-f8e4a3f3e272
66 // end_of_file