1 // ==========================================================
2 // FreeImagePlus Test Script
3 //
4 // Design and implementation by
5 // - Herv� Drolon (drolon@infonie.fr)
6 //
7 // This file is part of FreeImage 3
8 //
9 // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
10 // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
11 // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
12 // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
13 // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
14 // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
15 // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
16 // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
17 // THIS DISCLAIMER.
18 //
19 // Use at your own risk!
20 // ==========================================================
21 
22 #ifndef TEST_FREEIMAGEPLUS_API_H
23 #define TEST_FREEIMAGEPLUS_API_H
24 
25 #include "../FreeImagePlus.h"
26 #include <stdlib.h>
27 #include <assert.h>
28 #include <sys/stat.h>
29 
30 #include <iostream>
31 #include <cstdio>
32 
33 // --------------------------------------------------------------------------
34 // Memory IO test scripts
35 
36 /// Test saving to a memory stream
37 void testSaveMemIO(const char *lpszPathName);
38 /// Test loading from a buffer attached to a memory stream
39 void testLoadMemIO(const char *lpszPathName);
40 /// Test extracting a memory buffer from a memory stream
41 void testAcquireMemIO(const char *lpszPathName);
42 /// Test Loading / Saving from / to a memory stream using fipImage
43 void testImageMemIO(const char *lpszPathName);
44 /// Test the above functions
45 void testMemIO(const char *lpszPathName);
46 
47 // --------------------------------------------------------------------------
48 // Multipage test scripts
49 
50 /// Test multipage loading & saving
51 BOOL testCloneMultiPage(const char *input, const char *output, int output_flag);
52 /// Test the above functions
53 void testMultiPage(const char *lpszMultiPage);
54 
55 // --------------------------------------------------------------------------
56 // Multipage memory IO test scripts
57 
58 /// test FreeImage_LoadMultiBitmapFromMemory
59 BOOL testLoadMultiBitmapFromMemory(const char *lpszPathName);
60 /// test FreeImage_SaveMultiBitmapToMemory
61 BOOL testSaveMultiBitmapToMemory(const char *input, const char *output, int output_flag);
62 /// test FreeImage_LoadMultiBitmapFromMemory & FreeImage_SaveMultiBitmapToMemory
63 BOOL testMemoryStreamMultiPageOpenSave(const char *lpszPathName, char *output, int input_flag, int output_flag);
64 /// Test the above functions
65 void testMultiPageMemory(const char *lpszPathName);
66 
67 // --------------------------------------------------------------------------
68 // Multipage IO test scripts
69 
70 /// test multipage stream (opening)
71 BOOL testStreamMultiPageOpen(const char *input, int flags);
72 /// test multipage stream (save as)
73 BOOL testStreamMultiPageSave(const char *input, const char *output, int input_flag, int output_flag);
74 /// test multipage stream (open, modify, save as)
75 BOOL testStreamMultiPageOpenSave(const char *input, const char *output, int input_flag, int output_flag);
76 /// Test the above functions
77 void testStreamMultiPage(const char *lpszPathName);
78 
79 
80 #endif // TEST_FREEIMAGEPLUS_API_H
81