From 023b9573580677a2195c9abb35f4d74c478ac0b2 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Tue, 23 Aug 2022 11:15:20 -0400 Subject: [PATCH 1/3] init commit --- features/unit/program_sanity_check.feature | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 features/unit/program_sanity_check.feature diff --git a/features/unit/program_sanity_check.feature b/features/unit/program_sanity_check.feature new file mode 100644 index 00000000..2192f8b7 --- /dev/null +++ b/features/unit/program_sanity_check.feature @@ -0,0 +1,13 @@ +@unit.program_sanity_check +Feature: HeursticSanityCheck + Scenario Outline: Read a slice of bytes and heuristically decide if it look like program bytes + Given a base64 encoded program bytes for heuristic sanity check "" + When I start heuristic sanity check over the bytes + Then if there exists an error, the error contains "" + + Examples: + | bytes | error | + | RE43TUJNQ0w1SlEzUEZVUVM3VE1YNUFINEVFS09CSlZEVUY0VENWNldFUkFUS0ZMUUY0TVFVUFpUQQ== | get Algorand address | + | U0dPMUdLU3p5RTdJRVBJdFR4Q0J5dzl4OEZtbnJDRGV4aTkvY09VSk9pST0= | should not be b64 encoded | + | Q2FzdCBhIGNvbGQgZXllCm9uIGxpZmUsIG9uIGRlYXRoLgpIb3JzZW1hbiwgcGFzcyBieQ== | all ASCII printable characters | + | ASABASI= | | From ef88d18cfc2ddea4096053e05ec8e48288eb49ec Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 24 Aug 2022 15:21:15 -0400 Subject: [PATCH 2/3] check empty program --- features/unit/program_sanity_check.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/unit/program_sanity_check.feature b/features/unit/program_sanity_check.feature index 2192f8b7..028b6e96 100644 --- a/features/unit/program_sanity_check.feature +++ b/features/unit/program_sanity_check.feature @@ -7,6 +7,7 @@ Feature: HeursticSanityCheck Examples: | bytes | error | + | | empty program | | RE43TUJNQ0w1SlEzUEZVUVM3VE1YNUFINEVFS09CSlZEVUY0VENWNldFUkFUS0ZMUUY0TVFVUFpUQQ== | get Algorand address | | U0dPMUdLU3p5RTdJRVBJdFR4Q0J5dzl4OEZtbnJDRGV4aTkvY09VSk9pST0= | should not be b64 encoded | | Q2FzdCBhIGNvbGQgZXllCm9uIGxpZmUsIG9uIGRlYXRoLgpIb3JzZW1hbiwgcGFzcyBieQ== | all ASCII printable characters | From 5646349b10f1f7b739ffdfedc72476ab5cad801c Mon Sep 17 00:00:00 2001 From: Hang Su Date: Thu, 25 Aug 2022 11:23:35 -0400 Subject: [PATCH 3/3] more specific error checking santence --- features/unit/program_sanity_check.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/unit/program_sanity_check.feature b/features/unit/program_sanity_check.feature index 028b6e96..6b9b154b 100644 --- a/features/unit/program_sanity_check.feature +++ b/features/unit/program_sanity_check.feature @@ -3,7 +3,7 @@ Feature: HeursticSanityCheck Scenario Outline: Read a slice of bytes and heuristically decide if it look like program bytes Given a base64 encoded program bytes for heuristic sanity check "" When I start heuristic sanity check over the bytes - Then if there exists an error, the error contains "" + Then if the heuristic sanity check throws an error, the error contains "" Examples: | bytes | error |