#THIS IS A TEST FILE TO READ A LONG LINE.
2: a lo-ng line! /* conffile_test.c : test suite for conffile.c */ static char *rcsid __attribute__((unused)) = "$Id: conffile_longline.txt,v 1.1.1.1 2004/10/27 20:14:07 tomono Exp $"; #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <assert.h> #include <stdlib.h> #include <stdio.h> #include "conffile.h" #include "version.h" int main( void ); int main( void ) { double goodmf, badmf; optics_minimizer_s *optics; display_version( "optimize_test", stderr ); lenses_file_usage( stderr ); optics = lenses_allocate( 2 ); assert( optics ); assert( lenses_write( optics, "conffile_test.0.lens" ) == 0 ); to_lens( optics->optics->lenses[0], 100, 300 ); to_lens( optics->optics->lenses[1], 201, 201 ); to_lens( optics->isfree->lenses[1], 1, 1 ); optics->star_obj = to_inf_double( 100 ); optics->star_img = to_inf_double( 0 ); optics->star_img_weight = 1; optics->star_mag = to_inf_double( -2 ); optics->star_mag_weight = 1; optics->pupil_img = to_inf_inf( 1 ); optics->pupil_img_weight = 1; optics->pupil_mag_weight = 0; assert( lenses_write( optics, "conffile_test.1.lens" ) == 0 ); badmf = merit_function( optics ); goodmf = minimize( optics, 1, 100, 10, 1e-10 ); fprintf( stderr, "minimization result MF:%g\n", goodmf ); assert( goodmf <= badmf ); assert( lenses_write( optics, "conffile_test.2.lens" ) == 0 ); lenses_free( optics ); assert( lenses_read( optics, "conffile_longline.txt" ) == NULL ); return EXIT_SUCCESS; }
