00001 /* $Id: irplib_filter-test.c,v 1.29 2009/10/27 11:58:33 llundin Exp $ 00002 * 00003 * This file is part of the ESO Common Pipeline Library 00004 * Copyright (C) 2001-2004 European Southern Observatory 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 00022 #ifdef HAVE_CONFIG_H 00023 # include <config.h> 00024 #endif 00025 00026 /*----------------------------------------------------------------------------- 00027 Includes 00028 -----------------------------------------------------------------------------*/ 00029 00030 #include <irplib_filter.h> 00031 00032 00033 /*----------------------------------------------------------------------------- 00034 Private function prototypes 00035 -----------------------------------------------------------------------------*/ 00036 00037 static void irplib_image_filter_background_line_test(void); 00038 00039 00040 /*----------------------------------------------------------------------------*/ 00044 /*----------------------------------------------------------------------------*/ 00045 int main(void) 00046 { 00047 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING); 00048 00049 irplib_image_filter_background_line_test(); 00050 00051 return cpl_test_end(0); 00052 } 00053 00054 00055 /*----------------------------------------------------------------------------*/ 00061 /*----------------------------------------------------------------------------*/ 00062 static void irplib_image_filter_background_line_test(void) 00063 { 00064 00065 cpl_error_code error; 00066 cpl_image * one = cpl_image_new(2, 2, CPL_TYPE_FLOAT); 00067 cpl_image * two = cpl_image_new(2, 2, CPL_TYPE_INT); 00068 00069 error = irplib_image_filter_background_line(NULL, two, 0, CPL_FALSE); 00070 cpl_test_error(CPL_ERROR_NULL_INPUT); 00071 cpl_test_eq(error, CPL_ERROR_NULL_INPUT); 00072 00073 error = irplib_image_filter_background_line(one, two, -1, CPL_FALSE); 00074 cpl_test_error(CPL_ERROR_ILLEGAL_INPUT); 00075 cpl_test_eq(error, CPL_ERROR_ILLEGAL_INPUT); 00076 00077 cpl_image_delete(one); 00078 cpl_image_delete(two); 00079 00080 return; 00081 00082 }