static PyObject *test(PyObject *self,PyObject *args) { double r; fprintf(stderr,"overflow"); r = overflow(1.e160); printerr(r); fprintf(stderr,"\ndiv by 0"); r = db0(0.0); printerr(r); fprintf(stderr,"\nnested outer"); r = nest1(0, 0.0); printerr(r); fprintf(stderr,"\nnested inner"); r = nest1(1, 1.0); printerr(r); fprintf(stderr,"\ntrailing outer"); r = nest1(2, 2.0); printerr(r); fprintf(stderr,"\nnested prior"); r = nest2(0, 0.0); printerr(r); fprintf(stderr,"\nnested interior"); r = nest2(1, 1.0); printerr(r); fprintf(stderr,"\nnested trailing"); r = nest2(2, 2.0); printerr(r); Py_INCREF (Py_None); return Py_None; }
void egg_test() { using BOOST_EGG_NEST_NAMES; (void)_1; (void)_2; (void)_3; (void)nest0; (void)nest1; (void)nest2; (void)nest3; (void)nest4; (void)nest5; (void)ref0; (void)ref1; (void)ref2; (void)ref3; (void)ref4; (void)ref5; (void)_0_; (void)_1_; (void)_2_; (void)_3_; (void)_4_; int i9 = 9; // \x -> (\y -> y(x)) BOOST_CHECK( nest2(_1_(_1))(_0_(_1))(i9)(_1) == 9 ); }
/*************************************************************************** * @brief GSkymap_healpix_construct ***************************************************************************/ void TestGSky::test_GSkymap_healpix_construct(void) { // Test void constructor test_try("Test void constructor"); try { GSkymap map; test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test correct Healpix constructors test_try("Test correct Healpix constructors"); try { GSkymap ring1("GAL", 1, "RING", 1); GSkymap ring2("GAL", 2, "RING", 1); GSkymap ring4("GAL", 4, "RING", 1); GSkymap ring8("GAL", 8, "RING", 1); GSkymap ring16("GAL", 16, "RING", 1); GSkymap ring32("GAL", 32, "RING", 1); GSkymap ring64("GAL", 64, "RING", 1); GSkymap ring128("GAL", 128, "RING", 1); GSkymap ring256("GAL", 256, "RING", 1); GSkymap ring512("GAL", 512, "RING", 1); GSkymap nest1("GAL", 1, "NEST", 1); GSkymap nest2("GAL", 2, "NEST", 1); GSkymap nest4("GAL", 4, "NEST", 1); GSkymap nest8("GAL", 8, "NEST", 1); GSkymap nest16("GAL", 16, "NEST", 1); GSkymap nest32("GAL", 32, "NEST", 1); GSkymap nest64("GAL", 64, "NEST", 1); GSkymap nest128("GAL", 128, "NEST", 1); GSkymap nest256("GAL", 256, "NEST", 1); GSkymap nest512("GAL", 512, "NEST", 1); GSkymap map1("CEL", 1, "RING", 1); GSkymap map2("CEL", 1, "RING", 2); GSkymap map3("EQU", 1, "RING", 1); GSkymap map4("EQU", 1, "NESTED", 1); test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test Healpix copy constructor test_try("Test Healpix copy constructor"); try { GSkymap ring1("GAL", 1, "RING", 1); GSkymap ring2 = ring1; test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test invalid coordsys in constructor test_try("Test invalid coordsys in constructor"); try { GSkymap map("HOR", 1, "RING", 1); test_try_failure(); } catch (GException::wcs_bad_coords &e) { test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test invalid nside in constructor test_try("Test invalid nside in constructor"); try { GSkymap map("GAL", 3, "RING", 1); test_try_failure(); } catch (GException::wcs_hpx_bad_nside &e) { test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test invalid ordering in constructor test_try("Test invalid ordering in constructor"); try { GSkymap map("GAL", 2, "SPHERICAL", 1); test_try_failure(); } catch (GException::wcs_hpx_bad_ordering &e) { test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Test invalid nmaps in constructor test_try("Test invalid nmaps in constructor"); try { GSkymap map("GAL", 2, "NEST", 0); test_try_failure(); } catch (GException::skymap_bad_par &e) { test_try_success(); } catch (std::exception &e) { test_try_failure(e); } // Exit test return; }