From 206c4c76cc9521c2443f5f418bd9aef5838a3e53 Mon Sep 17 00:00:00 2001 From: Levente Bajczi Date: Sun, 23 Jul 2023 17:45:37 +0200 Subject: [PATCH] Fixed tests --- .../mit/theta/graphsolver/patterns/patterns/BasicEventSet.kt | 4 ++++ .../mit/theta/graphsolver/patterns/patterns/BasicRelation.kt | 4 ++++ .../test/java/hu/bme/mit/theta/graphsolver/GraphSolverTest.kt | 1 + subprojects/xcfa/cat/src/main/antlr/Cat.g4 | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicEventSet.kt b/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicEventSet.kt index 854feade5d..a21d75fafa 100644 --- a/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicEventSet.kt +++ b/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicEventSet.kt @@ -19,5 +19,9 @@ import hu.bme.mit.theta.graphsolver.compilers.GraphPatternCompiler class BasicEventSet(val name: String) : NodePattern() { + init { + patternName = name + } + override fun accept(compiler: GraphPatternCompiler<*, T>): T = compiler.compile(this) } \ No newline at end of file diff --git a/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicRelation.kt b/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicRelation.kt index 95bf001b22..730aad40db 100644 --- a/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicRelation.kt +++ b/subprojects/solver/graph-solver/src/main/java/hu/bme/mit/theta/graphsolver/patterns/patterns/BasicRelation.kt @@ -19,5 +19,9 @@ import hu.bme.mit.theta.graphsolver.compilers.GraphPatternCompiler class BasicRelation(val name: String) : EdgePattern() { + init { + patternName = name + } + override fun accept(compiler: GraphPatternCompiler<*, T>): T = compiler.compile(this) } \ No newline at end of file diff --git a/subprojects/solver/graph-solver/src/test/java/hu/bme/mit/theta/graphsolver/GraphSolverTest.kt b/subprojects/solver/graph-solver/src/test/java/hu/bme/mit/theta/graphsolver/GraphSolverTest.kt index c838a0527a..b1e2997d88 100644 --- a/subprojects/solver/graph-solver/src/test/java/hu/bme/mit/theta/graphsolver/GraphSolverTest.kt +++ b/subprojects/solver/graph-solver/src/test/java/hu/bme/mit/theta/graphsolver/GraphSolverTest.kt @@ -62,6 +62,7 @@ class GraphSolverTest { @Test @Throws(IOException::class) fun test() { + compiler!!.addEvents(graphEvents!!) compiler!!.addFacts(graphEdges!!) val compiledConstraint = constraint!!.accept(compiler!!) solver!!.add(compiledConstraint) diff --git a/subprojects/xcfa/cat/src/main/antlr/Cat.g4 b/subprojects/xcfa/cat/src/main/antlr/Cat.g4 index 5e5303af0f..e47e3515c4 100644 --- a/subprojects/xcfa/cat/src/main/antlr/Cat.g4 +++ b/subprojects/xcfa/cat/src/main/antlr/Cat.g4 @@ -8,7 +8,7 @@ name: (QUOT? NAME+ QUOT?) ; scopeBody - : (procCall | functionDef | procDef | definition | includeFile)+ + : (procCall | functionDef | procDef | definition | includeFile)* ; procCall