From 6f1e9cb3b05f280ce6a9490719d8279d528c1512 Mon Sep 17 00:00:00 2001 From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Tue, 11 May 2010 14:27:37 +0000 Subject: [PATCH] fixes to run unit tests on login nodes git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2238 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/bindings/tests/test_msms.py | 5 ++++- modules/io/tests/test_io_pdb.cc | 18 +++++++++--------- modules/io/tests/test_io_sdf.cc | 10 +++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/bindings/tests/test_msms.py b/modules/bindings/tests/test_msms.py index 54c1ab5b8..8cd56ee5a 100755 --- a/modules/bindings/tests/test_msms.py +++ b/modules/bindings/tests/test_msms.py @@ -32,4 +32,7 @@ if __name__ == "__main__": except(settings.FileNotFound): print "Could not find msms executable: ignoring unit tests" exit(0) - unittest.main() + try: + unittest.main() + except Exception, e: + print e diff --git a/modules/io/tests/test_io_pdb.cc b/modules/io/tests/test_io_pdb.cc index 54d7d49a9..3b9b691c3 100644 --- a/modules/io/tests/test_io_pdb.cc +++ b/modules/io/tests/test_io_pdb.cc @@ -163,15 +163,15 @@ BOOST_AUTO_TEST_CASE(anisou_record) mol::AtomHandle a1=ent.FindAtom("A", mol::ResNum(7), "N"); BOOST_REQUIRE(a1.IsValid()); mol::AtomProp props=a1.GetAtomProps(); - BOOST_CHECK_CLOSE( 0.0100, props.anisou(0, 0), 1e-4); - BOOST_CHECK_CLOSE(-0.0016, props.anisou(1, 0), 1e-4); - BOOST_CHECK_CLOSE(-0.0026, props.anisou(2, 0), 1e-4); - BOOST_CHECK_CLOSE(-0.0016, props.anisou(0, 1), 1e-4); - BOOST_CHECK_CLOSE( 0.0110, props.anisou(1, 1), 1e-4); - BOOST_CHECK_CLOSE(-0.0054, props.anisou(2, 1), 1e-4); - BOOST_CHECK_CLOSE(-0.0026, props.anisou(0, 2), 1e-4); - BOOST_CHECK_CLOSE(-0.0054, props.anisou(1, 2), 1e-4); - BOOST_CHECK_CLOSE( 0.0120, props.anisou(2, 2), 1e-4); + BOOST_CHECK_CLOSE(Real( 0.0100), props.anisou(0, 0), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0016), props.anisou(1, 0), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0026), props.anisou(2, 0), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0016), props.anisou(0, 1), Real(1e-4)); + BOOST_CHECK_CLOSE(Real( 0.0110), props.anisou(1, 1), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0054), props.anisou(2, 1), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0026), props.anisou(0, 2), Real(1e-4)); + BOOST_CHECK_CLOSE(Real(-0.0054), props.anisou(1, 2), Real(1e-4)); + BOOST_CHECK_CLOSE(Real( 0.0120), props.anisou(2, 2), Real(1e-4)); } BOOST_AUTO_TEST_CASE(only_66_cols) diff --git a/modules/io/tests/test_io_sdf.cc b/modules/io/tests/test_io_sdf.cc index 19cdf7f49..8f26c6fbe 100644 --- a/modules/io/tests/test_io_sdf.cc +++ b/modules/io/tests/test_io_sdf.cc @@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(simple_sdf) BOOST_CHECK_EQUAL(eh.GetChainCount(), 1); BOOST_CHECK_EQUAL(eh.GetAtomCount(), 6); BOOST_CHECK_EQUAL(eh.GetBondCount(), 6); - BOOST_CHECK_CLOSE(eh.GetMass(), 121.545502, 1e-4); + BOOST_CHECK_CLOSE(eh.GetMass(), Real(121.545502), Real(1e-4)); // check atom/bond types mol::AtomHandle ah=eh.GetAtomList()[0]; @@ -68,10 +68,10 @@ BOOST_AUTO_TEST_CASE(simple_sdf) BOOST_CHECK_EQUAL(ah.GetElement(), "N"); BOOST_CHECK_EQUAL(ah2.GetElement(), "Cl"); - BOOST_CHECK_CLOSE(ah.GetRadius(), 1.55, 1e-2); - BOOST_CHECK_CLOSE(ah2.GetRadius(), 1.75, 1e-2); - BOOST_CHECK_CLOSE(ah.GetMass(), 14.0067, 1e-4); - BOOST_CHECK_CLOSE(ah2.GetMass(), 35.453, 1e-3); + BOOST_CHECK_CLOSE(ah.GetRadius(), Real(1.55), Real(1e-2)); + BOOST_CHECK_CLOSE(ah2.GetRadius(), Real(1.75), Real(1e-2)); + BOOST_CHECK_CLOSE(ah.GetMass(), Real(14.0067), Real(1e-4)); + BOOST_CHECK_CLOSE(ah2.GetMass(), Real(35.453), Real(1e-3)); BOOST_CHECK_EQUAL(ah.GetBondCount(), 3); BOOST_CHECK_EQUAL(ah2.GetBondCount(), 1); BOOST_CHECK_EQUAL(ah.GetCharge(), 1); -- GitLab