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

Function test_patternmatchingwithouttrailingzeros

tests/fluxpattern.cc:82–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void test_patternmatchingwithouttrailingzeros()
83{
84 FluxPattern fp(16, 0x000b);
85 const unsigned matching[] = {100, 100, 200, 100};
86 const unsigned notmatching[] = {100, 200, 100, 100};
87 const unsigned closematch1[] = {90, 90, 180, 90};
88 const unsigned closematch2[] = {110, 110, 220, 110};
89
90 FluxMatch match;
91 assert(fp.matches(&matching[4], match), true);
92 assert(match.intervals, 2U);
93
94 assert(fp.matches(&notmatching[4], match), false);
95
96 assert(fp.matches(&closematch1[4], match), true);
97 assert(match.intervals, 2U);
98
99 assert(fp.matches(&closematch2[4], match), true);
100 assert(match.intervals, 2U);
101}
102
103void test_patternmatchingwithtrailingzeros()
104{

Callers 1

mainFunction · 0.85

Calls 1

matchesMethod · 0.80

Tested by

no test coverage detected