Skip to content
Snippets Groups Projects
Commit c39aa927 authored by Bienchen's avatar Bienchen
Browse files

Added negative test to the unittests for the rule based builder

parent 673f29f3
No related branches found
No related tags found
No related merge requests found
...@@ -196,6 +196,12 @@ void verify_nucleotide_link(const ResidueHandle& p3, const ResidueHandle& p5) ...@@ -196,6 +196,12 @@ void verify_nucleotide_link(const ResidueHandle& p3, const ResidueHandle& p5)
p5.FindAtom("P"))); 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 ) BOOST_AUTO_TEST_SUITE( conop )
...@@ -221,6 +227,7 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect) ...@@ -221,6 +227,7 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect)
rb_builder.FillAtomProps(*i); rb_builder.FillAtomProps(*i);
} }
// running positive test
BOOST_MESSAGE("running distance based checks on cytosine"); BOOST_MESSAGE("running distance based checks on cytosine");
rb_builder.ConnectAtomsOfResidue(c0); rb_builder.ConnectAtomsOfResidue(c0);
verify_nucleotide_connectivity(c0); verify_nucleotide_connectivity(c0);
...@@ -236,6 +243,10 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect) ...@@ -236,6 +243,10 @@ BOOST_AUTO_TEST_CASE(nucleotide_based_connect)
BOOST_MESSAGE("connecting first uracil to second uracil"); BOOST_MESSAGE("connecting first uracil to second uracil");
rb_builder.ConnectResidueToNext(u1, u2); rb_builder.ConnectResidueToNext(u1, u2);
verify_nucleotide_link(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( ) BOOST_AUTO_TEST_SUITE_END( )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment