]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/test/thirdparty/Fuzzer/test/merge.test
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / test / thirdparty / Fuzzer / test / merge.test
1 CHECK: BINGO
2
3 RUN: rm -rf %tmp/T1 %tmp/T2
4 RUN: mkdir -p %tmp/T1 %tmp/T2
5 RUN: echo F..... > %tmp/T1/1
6 RUN: echo .U.... > %tmp/T1/2
7 RUN: echo ..Z... > %tmp/T1/3
8
9 # T1 has 3 elements, T2 is empty.
10 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1
11 CHECK1: MERGE-OUTER: 3 files, 3 in the initial corpus
12 CHECK1: MERGE-OUTER: 0 new files with 0 new features added
13
14 RUN: echo ...Z.. > %tmp/T2/1
15 RUN: echo ....E. > %tmp/T2/2
16 RUN: echo .....R > %tmp/T2/3
17 RUN: echo F..... > %tmp/T2/a
18 RUN: echo .U.... > %tmp/T2/b
19 RUN: echo ..Z... > %tmp/T2/c
20
21 # T1 has 3 elements, T2 has 6 elements, only 3 are new.
22 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK2
23 CHECK2: MERGE-OUTER: 9 files, 3 in the initial corpus
24 CHECK2: MERGE-OUTER: 3 new files with 3 new features added
25
26 # Now, T1 has 6 units and T2 has no new interesting units.
27 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK3
28 CHECK3: MERGE-OUTER: 12 files, 6 in the initial corpus
29 CHECK3: MERGE-OUTER: 0 new files with 0 new features added
30
31 # Check that we respect max_len during the merge and don't crash.
32 RUN: rm %tmp/T1/??*
33 RUN: echo looooooooong > %tmp/T2/looooooooong
34 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 -max_len=6 2>&1 | FileCheck %s --check-prefix=MAX_LEN
35 MAX_LEN: MERGE-OUTER: 3 new files
36
37 # Check that merge tolerates failures.
38 RUN: rm %tmp/T1/??*
39 RUN: echo 'FUZZER' > %tmp/T2/FUZZER
40 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=MERGE_WITH_CRASH
41 MERGE_WITH_CRASH: MERGE-OUTER: succesfull in 2 attempt(s)
42 MERGE_WITH_CRASH: MERGE-OUTER: 3 new files
43
44 # Check that we actually limit the size with max_len
45 RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 -max_len=5 2>&1 | FileCheck %s --check-prefix=MERGE_LEN5
46 MERGE_LEN5: MERGE-OUTER: succesfull in 1 attempt(s)