From c20b355dc42045c9bbc8974a9acd15354cd63a1a Mon Sep 17 00:00:00 2001 From: koen <koenwermer@gmail.com> Date: Sat, 28 Jan 2017 20:22:07 +0100 Subject: [PATCH] fixed small syntax errors in test programs --- .../Mutants/BST_no_parent.java | 41 +++++++++---------- .../Mutants/Stack_useless_property.java | 2 +- Main.hs | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Equivalent mutations/Mutants/BST_no_parent.java b/Equivalent mutations/Mutants/BST_no_parent.java index e5d8c9e..da3dfe3 100644 --- a/Equivalent mutations/Mutants/BST_no_parent.java +++ b/Equivalent mutations/Mutants/BST_no_parent.java @@ -32,33 +32,32 @@ class Tree } public void Insert(int id) { - Node newNode = new Node(); - newNode.item = id; - if (this.root == null) - this.root = newNode; - else + Node newNode = new Node(); + newNode.item = id; + if (this.root == null) + this.root = newNode; + else + { + Node current = this.root; + while (true) { - Node current = this.root; - while (true) + if (id < current.item) { - if (id < current.item) + if (current.leftc == null) { - if (current.leftc == null) - { - current.leftc = newNode; - return; - } - current = current.leftc; + current.leftc = newNode; + return; } - else + current = current.leftc; + } + else + { + if (current.rightc == null) { - if (current.rightc == null) - { - current.rightc = newNode; - return; - } - current = current.rightc; + current.rightc = newNode; + return; } + current = current.rightc; } } } diff --git a/Equivalent mutations/Mutants/Stack_useless_property.java b/Equivalent mutations/Mutants/Stack_useless_property.java index 5c87186..525c7c2 100644 --- a/Equivalent mutations/Mutants/Stack_useless_property.java +++ b/Equivalent mutations/Mutants/Stack_useless_property.java @@ -70,7 +70,7 @@ class Program } public boolean isEmpty() { - if (top == -1) return true; + if (this.top == -1) return true; return false; } diff --git a/Main.hs b/Main.hs index 6ee3314..34ecfd9 100644 --- a/Main.hs +++ b/Main.hs @@ -102,7 +102,7 @@ getPostCond t = case parser Language.Java.Parser.exp postCond' of -- Calculate the wlp (for testing purposes) calcWlp :: IO () calcWlp = do - source <- readFile (joinPath ["Equivalent mutations", "stack.java"]) -- sourcePath + source <- readFile (joinPath ["Equivalent mutations", "mutants", "Stack_useless_property.java"]) -- sourcePath let result = parser compilationUnit source -- GitLab