-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestImageHandler.c
55 lines (35 loc) · 1.1 KB
/
TestImageHandler.c
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
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include <check.h>
#include "image_handler.h"
#include "windows_handler.h"
//Cette variable doit être initialisé avant chaque test!
SDL_Surface *surface;
void setup(void){
surface = IMG_Load("anas.bmp");
//Selected_rect doit avoir la taille de la surface ici
//selected_rect.x=.y=0
//selected_rect.w = surface->w;
//selected_rect.h = surface->h
}
void teardown(void){
free(surface);
}
START_TEST(blackwhite_test){
BlackWhite(surface);
SDL_Surface *blacknwhite = IMG_Load("bwGIMP.png");
//on compare la surface qu'on a modifé, avec une surface modifiée par GIMP ou Photoshop
//ck_assert_int_eq(COMPARE_SURFACES(surface,blacknwhite,20),1);
}END_TEST
START_TEST(grayscale_test){
GrayScale(surface);
SDL_Surface *grayscaled = IMG_Load("gsGIMP.png");
//ck_assert_int_eq(COMPARE_SURFACES(surface,grayscaled,20),1);
}END_TEST
START_TEST(blackwhite_test){
Negative(surface);
SDL_Surface *negatived = IMG_Load("negGIMP.png");
//ck_assert_int_eq(COMPARE_SURFACES(surface,negatived,20),1);
}END_TEST
//int main(void) here du cours