blob: ee5b5edc90e62db41210deaecd336c73f4758c04 (
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
|
/*
** -*- C -*-
**
** testFind.c
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Feb 14 15:50:15 2007 jofret
** Last update Fri Feb 23 18:09:45 2007 jofret
**
** Copyright INRIA 2007
*/
#include <stdio.h>
#include "find.h"
#define ERROR 42
int sfindaTest() {
printf(">> Floats \n");
float goodArray[5] = {0.,2.,3.,5.,10.};
float badArray[5] = {0.,0.,0.,0.,0.};
if (sfinda(goodArray, 5) != 1) {
printf("ERROR ! : Test Failed (non empty array)\n");
return ERROR;
}
if (sfinda(badArray, 5) != NOT_FOUND) {
printf("ERROR ! : Test Failed (empty array)\n");
return ERROR;
}
return 0;
}
int dfindaTest() {
printf(">> Doubles \n");
/* FIXME : Implement some test here ... */
return 0;
}
int cfindaTest() {
printf(">> Float Complex \n");
/* FIXME : Implement some test here ... */
return 0;
}
int zfindaTest() {
printf(">> Double Complex \n");
/* FIXME : Implement some test here ... */
return 0;
}
int testFind() {
int sfindaStatus, dfindaStatus = 0;
int cfindaStatus, zfindaStatus = 0;
printf(">>>> Find Tests\n");
sfindaStatus = sfindaTest();
dfindaStatus = dfindaTest();
cfindaStatus = cfindaTest();
zfindaStatus = zfindaTest();
return (sfindaStatus + dfindaStatus +
cfindaStatus + zfindaStatus);
}
|