Skip to contentSkip to conversation

image-fuzzer: Trivial readability and formatting improvements

PATCH Applied Maria Kustova 2 participants 2 messages Sep 14, 2014 – Sep 17, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 image-fuzzer: Trivial readability and formatting improvements

---

v1 -> v2:
* Simplified format of test result strings (based on the review of Fam Zheng and Markus Armbruster).
* Reverted signature of the 'fuzz.selector()' function (based on the review of Stefan Hajnoczi).

 tests/image-fuzzer/qcow2/fuzz.py | 11 ++++-----
 tests/image-fuzzer/runner.py     | 49 ++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 32 deletions(-)
tests/image-fuzzer/qcow2/fuzz.py +4 -7
index 6e272c6..7045aef 100644
@@ -130,7 +130,6 @@ def selector(current, constraints, validate=int_validator):
     randomly selects one value satisfying at least one constraint (depending on
     constraints overlaps).
     """
-
     def iter_validate(c):
         """Apply validate() only to constraints represented as lists.
 
@@ -337,9 +336,8 @@ def l1_entry(current):
     constraints = UINT64_V
     # Reserved bits are ignored
     # Added a possibility when only flags are fuzzed
-    offset = 0x7fffffffffffffff & random.choice([selector(current,
-                                                          constraints),
-                                                 current])
+    offset = 0x7fffffffffffffff & \
+             random.choice([selector(current, constraints), current])
     is_cow = random.randint(0, 1)
     return offset + (is_cow << UINT64_M)
 
@@ -349,9 +347,8 @@ def l2_entry(current):
     constraints = UINT64_V
     # Reserved bits are ignored
     # Add a possibility when only flags are fuzzed
-    offset = 0x3ffffffffffffffe & random.choice([selector(current,
-                                                          constraints),
-                                                 current])
+    offset = 0x3ffffffffffffffe & \
+             random.choice([selector(current, constraints), current])
     is_compressed = random.randint(0, 1)
     is_cow = random.randint(0, 1)
     is_zero = random.randint(0, 1)
tests/image-fuzzer/runner.py +24 -25

120 lines not on this page · raw message

Signature · 1 line
1.9.3
#1 lore raw
Quoted 9 lines · Maria Kustova

---

v1 -> v2:
* Simplified format of test result strings (based on the review of Fam Zheng and Markus Armbruster).
* Reverted signature of the 'fuzz.selector()' function (based on the review of Stefan Hajnoczi).

Quoted 3 lines
 tests/image-fuzzer/qcow2/fuzz.py | 11 ++++-----
 tests/image-fuzzer/runner.py     | 49 ++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 32 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan