Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ cc_library(
linkstatic = True, # Must be linked statically even when dynamic_mode=on.
deps = [
":centipede_runner_no_main",
":execution_metadata",
":mutation_data",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/types:span",
Expand Down Expand Up @@ -1957,7 +1958,7 @@ cc_test(
timeout = "long",
srcs = ["centipede_test.cc"],
data = [
"@com_google_fuzztest//centipede",
":centipede",
"@com_google_fuzztest//centipede/testing:abort_fuzz_target",
"@com_google_fuzztest//centipede/testing:async_failing_target",
"@com_google_fuzztest//centipede/testing:expensive_startup_fuzz_target",
Expand Down
2 changes: 1 addition & 1 deletion centipede/centipede_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ CENTIPEDE_FLAG(
// https://bugs.chromium.org/p/chromium/issues/detail?id=853873#c2
0
#else
8192
10240
#endif
,
"If not zero, instructs the target to set setrlimit(RLIMIT_AS) to "
Expand Down
21 changes: 8 additions & 13 deletions centipede/centipede_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -963,14 +963,8 @@ TEST_F(CentipedeWithTemporaryLocalDir, GetsSeedInputs) {
CentipedeDefaultCallbacks callbacks(env, stop_condition);

std::vector<ByteArray> seeds;
EXPECT_EQ(callbacks.GetSeeds(10, seeds), 10);
EXPECT_THAT(seeds, testing::ContainerEq(std::vector<ByteArray>{
{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}));
EXPECT_EQ(callbacks.GetSeeds(5, seeds), 10);
EXPECT_THAT(seeds, testing::ContainerEq(
std::vector<ByteArray>{{0}, {1}, {2}, {3}, {4}}));
EXPECT_EQ(callbacks.GetSeeds(100, seeds), 10);
EXPECT_THAT(seeds, testing::ContainerEq(std::vector<ByteArray>{
callbacks.GetSeeds(10, seeds);
EXPECT_THAT(seeds, IsSupersetOf(std::vector<ByteArray>{
{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}));
}

Expand Down Expand Up @@ -1277,12 +1271,13 @@ TEST_F(CentipedeWithTemporaryLocalDir, UsesProvidedCustomMutator) {
"centipede/testing/fuzz_target_with_custom_mutator");
CentipedeDefaultCallbacks callbacks(env, stop_condition);

const std::vector<ByteArray> inputs = {{1}, {2}, {3}, {4}, {5}, {6}};
const std::vector<Mutant> mutants = callbacks.Mutate(
GetMutationInputRefsFromDataInputs(inputs), inputs.size());
const std::vector<ByteArray> inputs = {{99}};
const std::vector<Mutant> mutants =
callbacks.Mutate(GetMutationInputRefsFromDataInputs(inputs), 5);

// The custom mutator just returns the original inputs as mutants.
EXPECT_EQ(inputs, GetDataFromMutants(mutants));
// The custom mutator just duplicates the original inputs as mutants.
EXPECT_EQ(GetDataFromMutants(mutants),
(std::vector<ByteArray>{{99}, {99}, {99}, {99}, {99}}));
}

TEST_F(CentipedeWithTemporaryLocalDir, FailsOnMisbehavingCustomMutator) {
Expand Down
Loading
Loading