From 03c4c6ddedefc63c8785de05b275ae7662d3bea3 Mon Sep 17 00:00:00 2001 From: Vadim Afanasyev Date: Mon, 17 Jun 2024 19:58:29 +0800 Subject: [PATCH] Added the first program to ArkTS initial program corpus taken from ArkTS Kit examples --- InitialArkTSCorpus/README.md | 12 ++++++++++++ InitialArkTSCorpus/hashMapEmpty.fzil | Bin 0 -> 120 bytes InitialArkTSCorpus/hashMapEmpty.js | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 InitialArkTSCorpus/README.md create mode 100644 InitialArkTSCorpus/hashMapEmpty.fzil create mode 100644 InitialArkTSCorpus/hashMapEmpty.js diff --git a/InitialArkTSCorpus/README.md b/InitialArkTSCorpus/README.md new file mode 100644 index 0000000..fb69546 --- /dev/null +++ b/InitialArkTSCorpus/README.md @@ -0,0 +1,12 @@ +# How To Extend Initial ArkTS Corpus + +This corpus is generated from ArkTS API examples: + +In order to extend the corpus please follow the steps: + +1. Convert the given TypeScript code with the help from playground. Use import line so the compiler understands that you are using the API extension and is able to produce JavaScript code. +2. Create a new `.js` file with this code in `InitialArkTSCorpus` folder. +3. Compile the given file to create corresponding `.fzil` program file (serialized `Program` class representation of FuzzIL program): `swift run FuzzILTool --compile ./InitialArkTSCorpus/.js` +4. Run fuzzing with importing of the initial ArkTS corpus. Provide the following options to FuzzilliCli: `--importCorpus=./InitialArkTSCorpus --corpusImportMode=full` + +The full mode means you do not need to either assess or minimize the provided programs. They will be fed to mutators as is. diff --git a/InitialArkTSCorpus/hashMapEmpty.fzil b/InitialArkTSCorpus/hashMapEmpty.fzil new file mode 100644 index 0000000000000000000000000000000000000000..be9ff5f4ceb0c394536d9f5545d30ca8581de5a1 GIT binary patch literal 120 zcmd-Q`2K-y?TI;VCuhxlBk0Ph?jt0`#mI1oorjAnJtsdYF()J=vsg%&i;01;iv=j? zSd<-5lv$Qok}4#?#l*#K*nS#%(#&Gl+=7xy0MUybApigX literal 0 HcmV?d00001 diff --git a/InitialArkTSCorpus/hashMapEmpty.js b/InitialArkTSCorpus/hashMapEmpty.js new file mode 100644 index 0000000..b7466bf --- /dev/null +++ b/InitialArkTSCorpus/hashMapEmpty.js @@ -0,0 +1,4 @@ +let arkPrivate = globalThis.ArkPrivate; +var HashMap = arkPrivate.Load(arkPrivate.HashMap); +const hashMap = new HashMap(); +let result = hashMap.isEmpty(); -- Gitee