From b5a4341847dc02c57ec60a4b1f0c985a3bae58a2 Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 30 Jun 2016 17:07:58 +0800 Subject: [PATCH 1/4] Skip transfer name which do not need instead of raise exception Signed-off-by: Luyao Huang --- dice/core/constraint.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dice/core/constraint.py b/dice/core/constraint.py index f807036..7bfae08 100644 --- a/dice/core/constraint.py +++ b/dice/core/constraint.py @@ -286,8 +286,7 @@ def apply(self, item): """ def _name2path(name): if not name.startswith(self.path_prefix): - raise ConstraintError( - "Solution %s is not a path variable" % name) + return name return name[len(self.path_prefix):].replace('_', '/') t = self._choose() From 65f4026f1cbbaf6a5fae10adfe9b1e254e6b83d5 Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 30 Jun 2016 17:13:56 +0800 Subject: [PATCH 2/4] Fix wrong __repr__ for ast.Call Signed-off-by: Luyao Huang --- dice/core/trace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dice/core/trace.py b/dice/core/trace.py index fc34eb0..30733ac 100644 --- a/dice/core/trace.py +++ b/dice/core/trace.py @@ -45,6 +45,8 @@ def __repr__(self): for line in self.trace: if isinstance(line, ast.Compare): s = str(line.ops[0].__class__.__name__) + elif isinstance(line, ast.Call): + s = line.func.id else: s = line.value.func.id lines.append(s) From 0434ee25465b16d084b4afe616eecd081244bb7e Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 30 Jun 2016 17:16:10 +0800 Subject: [PATCH 3/4] Fix broken example Signed-off-by: Luyao Huang --- examples/pyramid/oracles/pyramid.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/pyramid/oracles/pyramid.yaml b/examples/pyramid/oracles/pyramid.yaml index bb701b3..6543635 100644 --- a/examples/pyramid/oracles/pyramid.yaml +++ b/examples/pyramid/oracles/pyramid.yaml @@ -1,14 +1,13 @@ - name: option - target: option - tree: | - if self is Integer: - if self < 0: + oracle: | + if option is Integer: + if option < 0: return FAIL('Min input is 0') - elif self > 9223372036854775808: + elif option > 9223372036854775808: return FAIL('Number overflow') - elif self > 1000: + elif option > 1000: return FAIL('Max input is 1000') else: - return PASS() + return SUCCESS() else: return FAIL('Invalid number') From eb9c82fe32274653db84a9a158fba676193558ea Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 30 Jun 2016 17:26:39 +0800 Subject: [PATCH 4/4] Fix sphinx dependency for Travis CI job Signed-off-by: Luyao Huang --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index c05e22c..3f0966f 100644 --- a/tox.ini +++ b/tox.ini @@ -32,3 +32,4 @@ commands = deps = -rrequirements.txt sphinx + sphinx_rtd_theme