aboutsummaryrefslogtreecommitdiffstats
path: root/src/StateTestsFiller/ManyFunctionsGenerator.py
diff options
context:
space:
mode:
authorDimitry <dimitry@ethdev.com>2016-12-05 19:12:05 +0800
committerDimitry <dimitry@ethdev.com>2016-12-05 19:12:05 +0800
commite2a69159c863d810a368eda8aa417290d95dc52e (patch)
tree75da52555f6c077fdf580b24bcd8268c968da62e /src/StateTestsFiller/ManyFunctionsGenerator.py
parent35cfcf16190fc3e56ee11ead23452c633e2fca28 (diff)
downloaddexon-tests-e2a69159c863d810a368eda8aa417290d95dc52e.tar.gz
dexon-tests-e2a69159c863d810a368eda8aa417290d95dc52e.tar.zst
dexon-tests-e2a69159c863d810a368eda8aa417290d95dc52e.zip
Test Fillers (Sources for the tests)
Diffstat (limited to 'src/StateTestsFiller/ManyFunctionsGenerator.py')
-rw-r--r--src/StateTestsFiller/ManyFunctionsGenerator.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/StateTestsFiller/ManyFunctionsGenerator.py b/src/StateTestsFiller/ManyFunctionsGenerator.py
new file mode 100644
index 000000000..b4f36af0e
--- /dev/null
+++ b/src/StateTestsFiller/ManyFunctionsGenerator.py
@@ -0,0 +1,24 @@
+
+n = 100
+
+splitNumBegin = 128 - (n / 2)
+i = 1
+
+template = """
+ function right{0}(uint seed) returns (uint) {{
+ var r = nextRand(seed);
+ if (r >= 2**{2})
+ return right{1}(r);
+ return left{1}(r);
+ }}
+
+ function left{0}(uint seed) returns (uint) {{
+ var r = nextRand(nextRand(seed));
+ if (r >= 2**{2})
+ return left{1}(r);
+ return right{1}(r);
+ }}
+"""
+
+for i in range(1, n):
+ print template.format(i, i + 1, i + splitNumBegin) \ No newline at end of file