This is an archive of the discontinued LLVM Phabricator instance.

Make libFuzzer test more resilient to changes
ClosedPublic

Authored by george.karpenkov on Aug 2 2017, 2:20 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

kcc accepted this revision.Aug 2 2017, 2:21 PM

LGTM

This revision is now accepted and ready to land.Aug 2 2017, 2:21 PM
This revision was automatically updated to reflect the committed changes.

@kcc my bad, strnstr is actually not available outside of FreeBSD-like systems.
Would it be OK to change to strstr?

kcc added a comment.Aug 2 2017, 3:33 PM

@kcc my bad, strnstr is actually not available outside of FreeBSD-like systems.
Would it be OK to change to strstr?

Data is not null-terminated, so you will need to copy it to a null-terminated buffer first.

Why not memmem?

@kcc that seems to work in both environments, but makes me confused as to why it would act differently from strncmp, since we only enter the branch if length are equal. Yet when running under lit, one version times out, and another finishes in 0.8 seconds.

@kcc Great, memmem is not available on Windows :P

kcc added a comment.Aug 3 2017, 2:31 PM

But that won't matter for us soon, right?

@kcc so should I proceed with disabling tests on Windows? Feels terrible to say that "tests pass" when they don't.

kcc added a comment.Aug 3 2017, 2:36 PM

Yes, please make check-fuzzer a no-op on windows