1 /* 2 Copyright 2005-2007 Adobe Systems Incorporated 3 4 Use, modification and distribution are subject to the Boost Software License, 5 Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 http://www.boost.org/LICENSE_1_0.txt). 7 8 See http://stlab.adobe.com/gil for most recent version including documentation. 9 */ 10 // main.cpp : Runs all GIL tests. 11 // 12 13 #include <fstream> 14 #include <iostream> 15 16 #define main main1 17 #include "channel.cpp" 18 #undef main 19 20 #define main main2 21 #define value_core pixel_value_core 22 #define reference_core pixel_reference_core 23 #include "pixel.cpp" 24 #undef value_core 25 #undef reference_core 26 #undef main 27 28 #define main main3 29 #include "pixel_iterator.cpp" 30 #undef main 31 32 #define main main4 33 #include "image.cpp" 34 #undef main 35 36 #define main main5 37 #include "image_io.cpp" 38 #undef main 39 40 void test_channel(); 41 void test_pixel(); 42 void test_pixel_iterator(); 43 void test_image(const char*); 44 void test_image_io(); 45 void test_gimage(); 46 main(int argc,char * argv[])47int main(int argc, char* argv[]) { 48 test_pixel(); 49 test_channel(); 50 test_pixel_iterator(); 51 test_image_io(); 52 53 const char* local_name = "gil_reference_checksums.txt"; 54 const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt"; 55 56 std::ifstream file_is_there(local_name); 57 if (file_is_there) { 58 test_image(local_name); 59 } else { 60 std::ifstream file_is_there(name_from_status); 61 if (file_is_there) 62 test_image(name_from_status); 63 else { 64 std::cerr << "Unable to open gil_reference_checksums.txt"<<std::endl; 65 return 1; 66 } 67 } 68 69 return 0; 70 } 71