NAME

helper - Test helper routines

SYNOPSIS

compare_star( $star1, $star2 );
compare_catalog( $cat1, $cat2 );

DESCRIPTION

Help routine for the test suite that are shared amongst more than one test but that are not useful outside of the context of the test suite.

FUNCTIONS

compare_catalog

Compare 2 catalogs.

compare_catalog( $cat1, $cat2 );

where $cat1 is the catalogue to be tested, and $cat2 is the reference catalogue.

Catalogs must be Astro::Catalog objects. Currently simply compares each star in teh catalog, without forcing a new sort (so order is important).

compare_mpc_catalog

Compare two MPC catalogues.

compare_mpc_catalog( $cat1, $cat2 );

where $cat1 is the catalogue to be tested, and $cat2 is the reference catalogue.

Catalogs must be Astro::Catalog objects. Currently simply compares each star in teh catalog, without forcing a new sort (so order is important).

This method differs from compare_catalog() in that this one does not do direct comparisons between RA and Dec for the two catalogues; it only checks to make sure that the tested star is within one arcminute of the reference star. It also sorts both catalogues by RA. This helps compensate for the changing coordinates of minor planets as returned from the MPC.

compare_star

Compare the contents of two stars. Currently compares position, ID and filters.

compare_star( $star1, $star2 );

where $star1 is the star to be tested and $star2 is the reference star.

compare_mpc_star

Compare the contents of two stars. Currently compares position, ID and filters.

compare_star( $star1, $star2 );

where $star1 is the star to be tested and $star2 is the reference star.

This method differs from compare_star in that it does not do separate RA and Dec comparisons; it checks to see if the tested star is within one arcminute of the reference star.

USAGE

Requires that your tests are written using Test::More and that the top of each test includes the code:

my $p = ( -d "t" ?  "t/" : "");
do $p."helper.pl" or die "Error reading test functions: $!";

This allows the test to be run from inside or outside the test directory.

SEE ALSO

Test::More

COPYRIGHT

Copyright (C) 2001-2003 University of Exeter. All Rights Reserved. Some modificiations Copyright (C) 2003 Particle Physics and Astronomy Research Council. All Rights Reserved.

This program was written as part of the eSTAR project and is free software; you can redistribute it and/or modify it under the terms of the GNU Public License.

AUTHORS

Alasdair Allan <aa@astro.ex.ac.uk>, Tim Jenness <tjenness@cpan.org>, Brad Cavanagh <b.cavanagh@jach.hawaii.edu>