2021-10-17 20:23:35 +02:00
|
|
|
/*
|
|
|
|
* tests du systeme de cache
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2023-07-20 12:03:43 +02:00
|
|
|
#include <sys/time.h>
|
2021-10-17 20:23:35 +02:00
|
|
|
|
2023-07-20 12:03:43 +02:00
|
|
|
#include "../floatimg.h"
|
2021-10-17 20:23:35 +02:00
|
|
|
#include "cachengn.h"
|
|
|
|
|
2023-07-20 12:03:43 +02:00
|
|
|
int verbosity;
|
|
|
|
|
2021-11-26 23:10:29 +01:00
|
|
|
#define IMGW 320
|
|
|
|
#define IMGH 240
|
2023-07-20 12:03:43 +02:00
|
|
|
|
|
|
|
#define SIZE 5 // number of slots
|
2021-11-26 23:10:29 +01:00
|
|
|
#define NBRI 1000
|
|
|
|
|
2021-10-17 20:23:35 +02:00
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2021-11-26 23:10:29 +01:00
|
|
|
int foo;
|
2023-07-20 12:03:43 +02:00
|
|
|
FloatImg *picz;
|
|
|
|
char *fname = "quux.fimg";
|
2021-10-17 20:23:35 +02:00
|
|
|
|
2023-07-20 12:03:43 +02:00
|
|
|
fprintf(stderr, "\nTest of the cache engin - %s %s\n",
|
|
|
|
__DATE__, __TIME__);
|
2021-11-26 23:10:29 +01:00
|
|
|
cachengn_print_version(1);
|
|
|
|
|
|
|
|
foo = init_empty_cache(IMGW, IMGH, SIZE, NBRI);
|
2023-07-20 12:03:43 +02:00
|
|
|
fprintf(stderr, " init_empty_cache --> %d\n", foo);
|
|
|
|
|
|
|
|
foo = liste_le_cache((unsigned int)'U');
|
|
|
|
fprintf(stderr, " liste le cache --> %d\n", foo);
|
|
|
|
|
|
|
|
picz = give_me_thiz_picz(fname, 0);
|
|
|
|
if (NULL == picz) {
|
|
|
|
fprintf(stderr, " error 'givemeapicz' on '%s'\n", fname);
|
|
|
|
}
|
|
|
|
|
|
|
|
picz = give_me_thiz_picz(fname, 0);
|
|
|
|
if (NULL == picz) {
|
|
|
|
fprintf(stderr, " error 'givemeapicz' on '%s'\n", fname);
|
|
|
|
}
|
2021-10-17 20:23:35 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
|