From c39aa92700a216b3d4c9aa3d6583dab17139eb46 Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Fri, 1 Jul 2011 13:15:36 +0200 Subject: [PATCH] Added negative test to the unittests for the rule based builder --- modules/conop/tests/test_rule_based_builder.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/conop/tests/test_rule_based_builder.cc b/modules/conop/tests/test_rule_based_builder.cc index 2232ce3d6..0bc08d404 100644 --- a/modules/conop/tests/test_rule_based_builder.cc +++ b/modules/conop/tests/test_rule_based_builder.cc @@ -196,6 +196,12 @@ void verify_nucleotide_link(const ResidueHandle& p3, const ResidueHandle& p5) p5.FindAtom("P"))); } +void verify_nucleotide_nolink(const ResidueHandle& p3, const ResidueHandle& p5) +{ + BOOST_CHECK(!BondExists(p3.FindAtom("O3'"), + p5.FindAtom("P"))); +} + BOOST_AUTO_TEST_SUITE( conop ) @@ -221,6 +227,7 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect) rb_builder.FillAtomProps(*i); } + // running positive test BOOST_MESSAGE("running distance based checks on cytosine"); rb_builder.ConnectAtomsOfResidue(c0); verify_nucleotide_connectivity(c0); @@ -236,6 +243,10 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect) BOOST_MESSAGE("connecting first uracil to second uracil"); rb_builder.ConnectResidueToNext(u1, u2); verify_nucleotide_link(u1, u2); + // one negative test + BOOST_MESSAGE("connecting cytosine to second uracil"); + rb_builder.ConnectResidueToNext(c0, u2); + verify_nucleotide_nolink(c0, u2); } BOOST_AUTO_TEST_SUITE_END( ) -- GitLab