Statistiques
| Révision :

root / pobysoC-4.0 / src / test-pobyso-is-constant-expression.c

Historique | Voir | Annoter | Télécharger (1,37 ko)

1
/** @file test-pobyso-is-constant-expression.c
2
 * Name & purpose
3
 *
4
 * @author S. T.
5
 * @date 2014-11-14
6
 *
7
 * @details Verbosity manipulation are performed  to make sur  that verbosity
8
 *  suppression is correctly managed in pobyso_is_constant_expression()
9
 *  function.
10
 */
11
/******************************************************************************/
12
/* Headers, applying the "particular to general" convention.*/
13

    
14
#include "pobyso.h"
15

    
16
/* includes of local headers */
17

    
18
/* includes of project headers */
19

    
20
/* includes of system headers */
21

    
22
/* Other declarations */
23

    
24
/* Internal prototypes */
25

    
26
/* Types, constants and macros definitions */
27

    
28
/* Global variables */
29

    
30
/* Functions */
31

    
32
int
33
main(int argc, char** argv)
34
{
35
  pobyso_func_exp_t funcExpSo  = NULL;
36
  int outcome = 1;
37

    
38
  sollya_lib_init();
39

    
40
  /* No command line argument test the function with the NULL argument. */
41
  if (argc == 1)
42
  {
43
    outcome = pobyso_is_constant_expression(funcExpSo);
44
    sollya_lib_close();
45
    return ! outcome;
46
  }
47

    
48
  pobyso_set_canonical_on();
49
  funcExpSo = pobyso_parse_string(argv[1]);
50
  if (funcExpSo != NULL)
51
  {
52
    fprintf(stdout, "Sollya expression: ");
53
    pobyso_autoprint(funcExpSo);
54
  }
55
  else
56
  {
57
    fprintf(stdout, "NULL expression");
58
  }
59
  if (pobyso_is_constant_expression(funcExpSo))
60
  {
61
    sollya_lib_close();
62
    return 0;
63
  }
64
  else
65
  {
66
    sollya_lib_close();
67
    return 1;
68
  }
69
} /* End main */