Skip to content

Commit

Permalink
cnescatlab#113 Updated Unit Tests to take function localization into …
Browse files Browse the repository at this point in the history
…account
  • Loading branch information
brigittehuynh committed Jun 24, 2018
1 parent 7327ea5 commit b79c144
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class TestCOMDATAInitialisation {

public final static String ERROR_FILE = "error.sh";
public final static String NO_ERROR_FILE = "noError.sh";
public final static int[] LINES = { 9 };
public final static String[] LOCATIONS = { "MAIN PROGRAM" };
public final static int[] LINES = { 9, 15, 20, 25, 27, 32, 37 };
public final static String[] LOCATIONS = { "MAIN PROGRAM", "function1", "MAIN PROGRAM", "function2", "function2", "function3", "MAIN PROGRAM" };
public final AbstractChecker rule = new COMDATAInitialisation();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,33 @@ echo "Fichier KO de TU"
echo "------------------------------------------"

x=1
# la variable y n'est pas initiliaze
# the y variable is not initialized
z=$x+$y

function fonction ()
function function1 ()
{
b = 2
# the c variable is not initialized
a = $b+$c
}

# main
xx=y
# main - the y variable is not initialized

fonction2 ()
xx=$y

function2 ()
{
b = 2
a = $b+$c
# the b variable is not initialized
a = $b
# the y variable is not initialized
d = $y

function function3 ()
{
# the y variable is not initialized
e = $y
}
}

yy=y
# the y variable is not initialized
yy=$y
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,28 @@ echo "------------------------------------------"

x=1
y=2
z=$x+$y
z=$x+$y

function function1 ()
{
b = 2
c = 3
a = $b+$c
}

# main
xx=y

function2 ()
{
b = 2
a = $b+$xx
function function3 ()
{
e = $a
}


}

yy=$xx

0 comments on commit b79c144

Please sign in to comment.