MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / test_patternmatchingwithtrailingzeros

Function test_patternmatchingwithtrailingzeros

tests/fluxpattern.cc:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void test_patternmatchingwithtrailingzeros()
104{
105 FluxPattern fp(16, 0x0016);
106 const unsigned matching[] = {100, 100, 200, 100, 200};
107 const unsigned notmatching[] = {100, 200, 100, 100, 100};
108 const unsigned closematch1[] = {90, 90, 180, 90, 300};
109 const unsigned closematch2[] = {110, 110, 220, 110, 220};
110
111 FluxMatch match;
112 assert(fp.matches(&matching[5], match), true);
113 assert(match.intervals, 3U);
114
115 assert(fp.matches(&notmatching[5], match), false);
116
117 assert(fp.matches(&closematch1[5], match), true);
118 assert(match.intervals, 3U);
119
120 assert(fp.matches(&closematch2[5], match), true);
121 assert(match.intervals, 3U);
122}
123
124int main(int argc, const char* argv[])
125{

Callers 1

mainFunction · 0.85

Calls 1

matchesMethod · 0.80

Tested by

no test coverage detected