summaryrefslogtreecommitdiff
path: root/src/auxiliaryFunctions/isempty/testIsEmpty.c
blob: 041db1e29ecd6b1a3c1eb0b7fde135ee0dd09953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
**  -*- C -*-
**
** testIsEmpty.c
** Made by  Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on  Wed Feb 14 16:07:57 2007 jofret
** Last update Fri Feb 23 18:09:19 2007 jofret
**
** Copyright INRIA 2007
*/

#include <stdio.h>

#include "isEmpty.h"

#define ERROR 51

int sisemptyaTest() {
  printf(">> Float array\n");
  float empty[5] = {0., 0., 0., 0., 0.};
  float full[5] = {1., 2., 3., 0., 0.};

  if (sisEmptya(empty, 5) == false) {
    printf("ERROR ! : Test Failed (empty array)\n");
    return ERROR;
  }

  if (sisEmptya(full, 5) == true) {
    printf("ERROR ! : Test Failed (non empty array)\n");
    return ERROR;
  }

  return 0;
}

int disemptyaTest() {
  printf(">> Double array\n");

  double empty[5] = {0., 0., 0., 0., 0.};
  double full[5] = {1., 2., 3., 0., 0.};

  if (disEmptya(empty, 5) == false) {
    printf("ERROR ! : Test Failed (empty array)\n");
    return ERROR;
  }

  if (disEmptya(full, 5) == true) {
    printf("ERROR ! : Test Failed (non empty array)\n");
    return ERROR;
  }

  return 0;
}

int cisemptyaTest() {
  printf(">> Float Complex array\n");

  return 0;
}

int zisemptyaTest() {
  printf(">> Double Complex array\n");
  return 0;
}


int testIsEmpty() {
  int sisemptyaTestStatus, disemptyaTestStatus = 0;
  int cisemptyaTestStatus, zisemptyaTestStatus = 0;
  printf("\n>>>> IsEmpty Tests\n");
  sisemptyaTestStatus = sisemptyaTest();
  disemptyaTestStatus = disemptyaTest();
  cisemptyaTestStatus = cisemptyaTest();
  zisemptyaTestStatus = zisemptyaTest();

  return (sisemptyaTestStatus + disemptyaTestStatus +
	  cisemptyaTestStatus + zisemptyaTestStatus);
}