Work in progress

Creating function for validateing element ID strings
This commit is contained in:
Michael Tryby
2019-04-16 14:44:06 -04:00
parent 8989be193a
commit ac56971ef2
5 changed files with 74 additions and 9 deletions

View File

@@ -0,0 +1,33 @@
/*
******************************************************************************
Project: OWA EPANET
Version: 2.2
Module: test_cstrhelper.cpp
Description: tests for C string helper functions
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 04/16/2019
******************************************************************************
*/
#define BOOST_TEST_MODULE cstr_helper
#include <boost/test/unit_test.hpp>
#include "util/cstr_helper.h"
BOOST_AUTO_TEST_SUITE(test_cstrhelper)
BOOST_AUTO_TEST_CASE(test_validate_id){
BOOST_CHECK(cstr_validate_id("big tank") == false);
BOOST_CHECK(cstr_validate_id("big\"tank") == false);
BOOST_CHECK(cstr_validate_id("big;tank") == false);
BOOST_CHECK(cstr_validate_id("big-tank") == true);
}
BOOST_AUTO_TEST_SUITE_END()