Commit d6e77b6e authored by Ing. Jan Trávníček's avatar Ing. Jan Trávníček

the generated subject tree should be longer than the pattern

parent c3d305ef
......@@ -13,10 +13,10 @@ static std::string qExtendAlphabet ( const std::string & s1, const std::string &
return "execute string::GeneralAlphabet::add $" + s1 + " <( string::GeneralAlphabet::get $" + s2 + " )";
}
static std::string qGenString ( const size_t & len, const size_t &alph_len, const std::string & var ) {
static std::string qGenString ( size_t min_len, size_t max_len, size_t alph_len, const std::string & var ) {
std::ostringstream oss;
oss << "execute string::generate::RandomStringFactory ";
oss << "( size_t )" << rand ( ) % len + 1;
oss << "( size_t )" << rand ( ) % ( max_len - min_len + 1 ) + min_len + 1;
oss << "( size_t )" << rand ( ) % alph_len + 1;
oss << "true | ";
oss << "string::simplify::NormalizeAlphabet - > $" + var;
......@@ -68,8 +68,8 @@ TEST_CASE ( "ExactMatching", "[integration]" ) {
SECTION ( "Random tests" ) {
for ( size_t i = 0; i < RANDOM_ITERATIONS; i++ ) {
ext::vector < std::string > qs = {
qGenString ( PATTERN_SIZE, ALPHABET_SIZE, "pattern" ),
qGenString ( SUBJECT_SIZE, ALPHABET_SIZE, "subject" ),
qGenString ( 0, PATTERN_SIZE, ALPHABET_SIZE, "pattern" ),
qGenString ( PATTERN_SIZE, SUBJECT_SIZE, ALPHABET_SIZE, "subject" ),
"execute stringology::exact::ExactFactorMatch $subject $pattern > $res1"
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment