MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / TEST

Function TEST

extern/re2/re2/testing/charclass_test.cc:198–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198TEST(TestCharClassBuilder, Adds) {
199 int nfail = 0;
200 for (size_t i = 0; i < arraysize(tests); i++) {
201 CharClassBuilder ccb;
202 CCTest* t = &tests[i];
203 for (int j = 0; t->add[j].lo >= 0; j++)
204 ccb.AddRange(t->add[j].lo, t->add[j].hi);
205 if (t->remove >= 0)
206 ccb.RemoveAbove(t->remove);
207 if (!CorrectCC(&ccb, t, "before copy (CharClassBuilder)"))
208 nfail++;
209 CharClass* cc = ccb.GetCharClass();
210 if (!CorrectCC(cc, t, "before copy (CharClass)"))
211 nfail++;
212 cc->Delete();
213
214 CharClassBuilder *ccb1 = ccb.Copy();
215 if (!CorrectCC(ccb1, t, "after copy (CharClassBuilder)"))
216 nfail++;
217 cc = ccb.GetCharClass();
218 if (!CorrectCC(cc, t, "after copy (CharClass)"))
219 nfail++;
220 cc->Delete();
221 delete ccb1;
222 }
223 EXPECT_EQ(nfail, 0);
224}
225
226} // namespace re2

Callers

nothing calls this directly

Calls 6

CorrectCCFunction · 0.85
AddRangeMethod · 0.80
RemoveAboveMethod · 0.80
GetCharClassMethod · 0.80
DeleteMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected