irplib_plugin-test.c

00001 /*                                                                            *
00002  *   This file is part of the ESO IRPLIB package                              *
00003  *   Copyright (C) 2004,2005 European Southern Observatory                    *
00004  *                                                                            *
00005  *   This library is free software; you can redistribute it and/or modify     *
00006  *   it under the terms of the GNU General Public License as published by     *
00007  *   the Free Software Foundation; either version 2 of the License, or        *
00008  *   (at your option) any later version.                                      *
00009  *                                                                            *
00010  *   This program is distributed in the hope that it will be useful,          *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of           *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
00013  *   GNU General Public License for more details.                             *
00014  *                                                                            *
00015  *   You should have received a copy of the GNU General Public License        *
00016  *   along with this program; if not, write to the Free Software              *
00017  *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA     *
00018  *                                                                            */
00019 
00020 #ifdef HAVE_CONFIG_H
00021 #  include <config.h>
00022 #endif
00023 
00024 /*-----------------------------------------------------------------------------
00025                                 Includes
00026  -----------------------------------------------------------------------------*/
00027 
00028 #include <irplib_plugin.h>
00029 #include <string.h>
00030 #include <float.h>
00031 
00032 /*-----------------------------------------------------------------------------
00033                                    Function prototypes
00034  -----------------------------------------------------------------------------*/
00035 
00036 /*----------------------------------------------------------------------------*/
00040 /*----------------------------------------------------------------------------*/
00041 
00042 
00043 /*----------------------------------------------------------------------------*/
00047 /*----------------------------------------------------------------------------*/
00048 
00049 int main(void)
00050 {
00051 
00052 
00053 
00054     cpl_parameterlist * parlist;
00055 
00056     /* Initialize CPL for unit testing */
00057     cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
00058 
00059     parlist = cpl_parameterlist_new();
00060 
00061 
00062     (void)irplib_parameterlist_get_double(parlist, "INST", "RECIPE", NULL);
00063     cpl_test_error(CPL_ERROR_NULL_INPUT);
00064 
00065     (void)irplib_parameterlist_get_double(parlist, "INST", NULL, "PAR");
00066     cpl_test_error(CPL_ERROR_NULL_INPUT);
00067 
00068     (void)irplib_parameterlist_get_double(parlist, NULL, "RECIPE", "PAR");
00069     cpl_test_error(CPL_ERROR_NULL_INPUT);
00070 
00071     (void)irplib_parameterlist_get_double(NULL, "INST", "RECIPE", "PAR");
00072     cpl_test_error(CPL_ERROR_NULL_INPUT);
00073 
00074     (void)irplib_parameterlist_get_double(parlist, "INST", "RECIPE", "PAR");
00075     cpl_test_error(CPL_ERROR_DATA_NOT_FOUND);
00076 
00077 
00078     (void)irplib_parameterlist_get_int(parlist, "INST", "RECIPE", NULL);
00079     cpl_test_error(CPL_ERROR_NULL_INPUT);
00080 
00081     (void)irplib_parameterlist_get_int(parlist, "INST", NULL, "PAR");
00082     cpl_test_error(CPL_ERROR_NULL_INPUT);
00083 
00084     (void)irplib_parameterlist_get_int(parlist, NULL, "RECIPE", "PAR");
00085     cpl_test_error(CPL_ERROR_NULL_INPUT);
00086 
00087     (void)irplib_parameterlist_get_int(NULL, "INST", "RECIPE", "PAR");
00088     cpl_test_error(CPL_ERROR_NULL_INPUT);
00089 
00090     (void)irplib_parameterlist_get_int(parlist, "INST", "RECIPE", "PAR");
00091     cpl_test_error(CPL_ERROR_DATA_NOT_FOUND);
00092 
00093 
00094     (void)irplib_parameterlist_get_bool(parlist, "INST", "RECIPE", NULL);
00095     cpl_test_error(CPL_ERROR_NULL_INPUT);
00096 
00097     (void)irplib_parameterlist_get_bool(parlist, "INST", NULL, "PAR");
00098     cpl_test_error(CPL_ERROR_NULL_INPUT);
00099 
00100     (void)irplib_parameterlist_get_bool(parlist, NULL, "RECIPE", "PAR");
00101     cpl_test_error(CPL_ERROR_NULL_INPUT);
00102 
00103     (void)irplib_parameterlist_get_bool(NULL, "INST", "RECIPE", "PAR");
00104     cpl_test_error(CPL_ERROR_NULL_INPUT);
00105 
00106     (void)irplib_parameterlist_get_bool(parlist, "INST", "RECIPE", "PAR");
00107     cpl_test_error(CPL_ERROR_DATA_NOT_FOUND);
00108 
00109 
00110     (void)irplib_parameterlist_get_string(parlist, "INST", "RECIPE", NULL);
00111     cpl_test_error(CPL_ERROR_NULL_INPUT);
00112 
00113     (void)irplib_parameterlist_get_string(parlist, "INST", NULL, "PAR");
00114     cpl_test_error(CPL_ERROR_NULL_INPUT);
00115 
00116     (void)irplib_parameterlist_get_string(parlist, NULL, "RECIPE", "PAR");
00117     cpl_test_error(CPL_ERROR_NULL_INPUT);
00118 
00119     (void)irplib_parameterlist_get_string(NULL, "INST", "RECIPE", "PAR");
00120     cpl_test_error(CPL_ERROR_NULL_INPUT);
00121 
00122     (void)irplib_parameterlist_get_string(parlist, "INST", "RECIPE", "PAR");
00123     cpl_test_error(CPL_ERROR_DATA_NOT_FOUND);
00124 
00125 
00126     cpl_parameterlist_delete(parlist);
00127 
00128     return cpl_test_end(0);
00129 }

Generated on 8 Mar 2011 for UVES Pipeline Reference Manual by  doxygen 1.6.1