src/tests.cpp
/**
 * @brief Load the test case JSON data from case_file and return that data in case_data.
 *
 * @param case_file relative or absolute path to case data.
 * @param case_data vector of strings that will be loaded with the cases.
 * @return true if all is loaded, false if some failure occurs.
 */
@brief Load the test case JSON data from case_file and return that data in case_data.
@param case_file relative or absolute path to case data.
@param case_data vector of strings that will be loaded with the cases.
@return true if all is loaded, false if some failure occurs.
@brief Load the test case JSON data from case_file and return that data in case_data . @param case_file relative or absolute path to case data . @param case_data vector of strings that will be loaded with the cases . @return true if all is loaded false if some failure occurs .
bool loadTestCases( const std::string& case_file, StrVector& case_data ) {
    std::string line;
    std::ifstream file{ case_file };
    if ( file.good() ) {
        while ( std::getline( file, line ) ) {
            string_utilities::strip( line ); 
            if ( line.length() > 0 && line[0] != '#' ) {
                case_data.push_back( line );
            }
        }
    } else {
        return false;
    }
    return( !case_data.empty() );
}
bool loadTestCases ( const std :: string & case_file , StrVector & case_data ) { std :: string line ; std :: ifstream file { case_file } ; if ( file . good ( ) ) { while ( std :: getline ( file , line ) ) { string_utilities :: strip ( line ) ; if ( line . length ( ) > 0 && line [ 0 ] != ' ' ) { case_data . push_back ( line ) ; } } } else { return false ; } return ( ! case_data . empty ( ) ) ; }
@brief Load the test case JSON data from case_file and return that data in case_data.
@brief Load the test case JSON data from case_file and return that data in case_data .
// skip empty lines and comments.