Adding comment test

This commit is contained in:
Michael Tryby
2019-03-22 15:34:34 -04:00
parent b02f1ef346
commit df4e62b550
8 changed files with 201 additions and 15 deletions

View File

@@ -131,4 +131,23 @@ BOOST_AUTO_TEST_CASE(add_set_pattern)
EN_deleteproject(&ph);
}
BOOST_FIXTURE_TEST_CASE(test_pattern_comments, FixtureOpenClose)
{
int index;
char comment[EN_MAXMSG + 1];
// Set pattern comment
error = EN_getpatternindex(ph, (char *)"1", &index);
BOOST_REQUIRE(error == 0);
error = EN_setcomment(ph, EN_TIMEPAT, index, (char *)"Time Pattern 1");
BOOST_REQUIRE(error == 0);
// Check pattern comment
error = EN_getpatternindex(ph, (char *)"1", &index);
BOOST_REQUIRE(error == 0);
error = EN_getcomment(ph, EN_TIMEPAT, index, comment);
BOOST_REQUIRE(error == 0);
BOOST_CHECK(check_string(comment, (char *)"Time Pattern 1"));
}
BOOST_AUTO_TEST_SUITE_END()