Skip to content

Commit

Permalink
15 novych testov + dnes pridu dalsie
Browse files Browse the repository at this point in the history
  • Loading branch information
marusak committed Apr 18, 2016
1 parent bb89aa9 commit 54c4ace
Show file tree
Hide file tree
Showing 45 changed files with 346 additions and 1 deletion.
68 changes: 67 additions & 1 deletion _stud_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ LOG_PATH="./moj-out/"
COUNT=0
ALL=0
mkdir -p moj-out
rm moj-out/*

#10 test for invalid arguments; Expected return code for all: 1

Expand Down Expand Up @@ -283,6 +284,72 @@ echo -n $? > ${LOG_PATH}test034.!!!
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test035.in --output=${LOCAL_OUT_PATH2}test035.out 2> ${LOG_PATH}test035.err
echo -n $? > ${LOG_PATH}test035.!!!

# test36: empty input: test036.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=ref-out/test005.out --output=${LOCAL_OUT_PATH2}test036.out 2> ${LOG_PATH}test036.err
echo -n $? > ${LOG_PATH}test036.!!!

# test37: details of empty class: test037.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test037.in --output=${LOCAL_OUT_PATH2}test037.out --details=A 2> ${LOG_PATH}test037.err
echo -n $? > ${LOG_PATH}test037.!!!

# test38: details of unknown class: test038.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test037.in --output=${LOCAL_OUT_PATH2}test038.out --details=B 2> ${LOG_PATH}test038.err
echo -n $? > ${LOG_PATH}test038.!!!

# test39: details of base class: test039.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test039.in --output=${LOCAL_OUT_PATH2}test039.out --details=A 2> ${LOG_PATH}test039.err
echo -n $? > ${LOG_PATH}test039.!!!

# test40: inheritance of private atributes: test40.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test40.in --output=${LOCAL_OUT_PATH2}test40.out --details 2> ${LOG_PATH}test40.err
echo -n $? > ${LOG_PATH}test40.!!!

#TEST 41 s --details=B sa nepusta! neviem co ma byt vysledok

# test42: private pure virtual method: test42.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test42.in --output=${LOCAL_OUT_PATH2}test42.out 2> ${LOG_PATH}test42.err
echo -n $? > ${LOG_PATH}test42.!!!

# test43: triangle conflict: test43.out; Expected return code: 21
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test43.in --output=${LOCAL_OUT_PATH2}test43.out 2> ${LOG_PATH}test43.err
echo -n $? > ${LOG_PATH}test43.!!!

# test44: triangle conflict solved by overriding: test44.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test44.in --output=${LOCAL_OUT_PATH2}test44.out 2> ${LOG_PATH}test44.err
echo -n $? > ${LOG_PATH}test44.!!!

# test45: triangle conflict solved by using:: : test45.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test45.in --output=${LOCAL_OUT_PATH2}test45.out --details=C 2> ${LOG_PATH}test45.err
echo -n $? > ${LOG_PATH}test45.!!!

# test46: triangle conflict solved by overiding method: test46.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test46.in --output=${LOCAL_OUT_PATH2}test46.out --details=C 2> ${LOG_PATH}test46.err
echo -n $? > ${LOG_PATH}test46.!!!

# test47: base class cannot be the same class: test47.out; Expected return code: 4
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test47.in --output=${LOCAL_OUT_PATH2}test47.out 2> ${LOG_PATH}test47.err
echo -n $? > ${LOG_PATH}test47.!!!

# test48: duplicit base class: test48.out; Expected return code: 4
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test48.in --output=${LOCAL_OUT_PATH2}test48.out 2> ${LOG_PATH}test48.err
echo -n $? > ${LOG_PATH}test48.!!!

# test49: unknown base class: test49.out; Expected return code: 4
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test49.in --output=${LOCAL_OUT_PATH2}test49.out 2> ${LOG_PATH}test49.err
echo -n $? > ${LOG_PATH}test49.!!!

# test50: static members: test50.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test50.in --output=${LOCAL_OUT_PATH2}test50.out --details=B 2> ${LOG_PATH}test50.err
echo -n $? > ${LOG_PATH}test50.!!!

# test51: types: test51.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test51.in --output=${LOCAL_OUT_PATH2}test51.out --details=A 2> ${LOG_PATH}test51.err
echo -n $? > ${LOG_PATH}test51.!!!





#Print results
RED='\033[0;31m'
END='\033[0m'
Expand Down Expand Up @@ -360,7 +427,6 @@ for i in `ls ./ref-out/ | grep -e '.*\.out$'`



rm moj-out/*
PASSED=$((ALL-COUNT))
printf "${GREEN}===================================================${END}\n"
printf "Failed ${BRED}$COUNT${END} "`[[ $COUNT -eq 1 ]] && echo -n "test" || echo -n "tests"`;
Expand Down
1 change: 1 addition & 0 deletions ref-out/test036.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
2 changes: 2 additions & 0 deletions ref-out/test036.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" ?>
<model/>
1 change: 1 addition & 0 deletions ref-out/test037.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
2 changes: 2 additions & 0 deletions ref-out/test037.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" ?>
<class kind="concrete" name="A"/>
1 change: 1 addition & 0 deletions ref-out/test038.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions ref-out/test038.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?>
1 change: 1 addition & 0 deletions ref-out/test039.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
13 changes: 13 additions & 0 deletions ref-out/test039.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<class kind="concrete" name="A">
<private>
<methods>
<method name="f" scope="instance" type="int">
<arguments/>
</method>
</methods>
<attributes>
<attribute name="x" scope="instance" type="int"/>
</attributes>
</private>
</class>
1 change: 1 addition & 0 deletions ref-out/test40.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
37 changes: 37 additions & 0 deletions ref-out/test40.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" ?>
<model>
<class kind="concrete" name="A">
<private>
<attributes>
<attribute name="x" scope="instance" type="int"/>
</attributes>
</private>
</class>
<class kind="concrete" name="D">
<inheritance>
<from name="C" privacy="private"/>
</inheritance>
</class>
<class kind="concrete" name="C">
<inheritance>
<from name="B" privacy="private"/>
</inheritance>
<private>
<attributes>
<attribute name="x1" scope="instance" type="int">
<from name="B"/>
</attribute>
</attributes>
</private>
</class>
<class kind="concrete" name="B">
<inheritance>
<from name="A" privacy="private"/>
</inheritance>
<public>
<attributes>
<attribute name="x1" scope="instance" type="int"/>
</attributes>
</public>
</class>
</model>
1 change: 1 addition & 0 deletions ref-out/test42.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
8 changes: 8 additions & 0 deletions ref-out/test42.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>
<model>
<class kind="abstract" name="A">
<class kind="abstract" name="B">
<class kind="abstract" name="C"/>
</class>
</class>
</model>
1 change: 1 addition & 0 deletions ref-out/test43.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21
Empty file added ref-out/test43.out
Empty file.
1 change: 1 addition & 0 deletions ref-out/test44.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
9 changes: 9 additions & 0 deletions ref-out/test44.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<model>
<class kind="concrete" name="A">
<class kind="concrete" name="B">
<class kind="concrete" name="C"/>
</class>
<class kind="concrete" name="C"/>
</class>
</model>
1 change: 1 addition & 0 deletions ref-out/test45.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
14 changes: 14 additions & 0 deletions ref-out/test45.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<class kind="concrete" name="C">
<inheritance>
<from name="A" privacy="public"/>
<from name="B" privacy="public"/>
</inheritance>
<private>
<attributes>
<attribute name="x" scope="instance" type="int">
<from name="B"/>
</attribute>
</attributes>
</private>
</class>
1 change: 1 addition & 0 deletions ref-out/test46.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
17 changes: 17 additions & 0 deletions ref-out/test46.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<class kind="concrete" name="C">
<inheritance>
<from name="A" privacy="public"/>
<from name="B" privacy="public"/>
</inheritance>
<private>
<methods>
<method name="f" scope="instance" type="int">
<arguments>
<argument name="z" type="int"/>
<argument name="hello" type="int"/>
</arguments>
</method>
</methods>
</private>
</class>
1 change: 1 addition & 0 deletions ref-out/test47.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Empty file added ref-out/test47.out
Empty file.
1 change: 1 addition & 0 deletions ref-out/test48.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Empty file added ref-out/test48.out
Empty file.
1 change: 1 addition & 0 deletions ref-out/test49.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Empty file added ref-out/test49.out
Empty file.
1 change: 1 addition & 0 deletions ref-out/test50.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
19 changes: 19 additions & 0 deletions ref-out/test50.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" ?>
<class kind="concrete" name="B">
<inheritance>
<from name="A" privacy="public"/>
</inheritance>
<public>
<methods>
<method name="f" scope="static" type="int">
<from name="A"/>
<arguments/>
</method>
</methods>
<attributes>
<attribute name="x" scope="static" type="int">
<from name="A"/>
</attribute>
</attributes>
</public>
</class>
1 change: 1 addition & 0 deletions ref-out/test51.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
19 changes: 19 additions & 0 deletions ref-out/test51.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" ?>
<class kind="concrete" name="A">
<private>
<attributes>
<attribute name="l" scope="instance" type="long int"/>
<attribute name="sh" scope="instance" type="short int"/>
<attribute name="z" scope="instance" type="int"/>
<attribute name="y" scope="instance" type="char"/>
<attribute name="w" scope="instance" type="wchar_t"/>
<attribute name="f" scope="instance" type="float"/>
<attribute name="s" scope="instance" type="signed int"/>
<attribute name="x" scope="instance" type="bool"/>
<attribute name="d" scope="instance" type="double"/>
<attribute name="u" scope="instance" type="unsigned char"/>
<attribute name="uli" scope="instance" type="unsigned long int"/>
<attribute name="pspi" scope="instance" type="signed short int *"/>
</attributes>
</private>
</class>
1 change: 1 addition & 0 deletions test037.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class A{};
4 changes: 4 additions & 0 deletions test039.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class A{
int f();
int x;
};
15 changes: 15 additions & 0 deletions test40.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class A{
private:
int x;
};

class B: A{
public:
int x1;
};

class C: private B{
};

class D: C{
};
12 changes: 12 additions & 0 deletions test41.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class A{
private:
int f(int x1, int x2);
int f(double x1);
};

class B: public A{
protected:
using A::f;

};

11 changes: 11 additions & 0 deletions test42.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class A{
private:
int f()=0;
};

class B: private A{
};

class C: private B{
};

10 changes: 10 additions & 0 deletions test43.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class A{
public:
int x;
};

class B: public A{
};

class C: public A, public B{
};
11 changes: 11 additions & 0 deletions test44.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class A{
public:
int x;
};

class B: public A{
};

class C: public A, public B{
int x;
};
11 changes: 11 additions & 0 deletions test45.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class A{
public:
int x;
};

class B: public A{
};

class C: public A, public B{
using B::x;
};
11 changes: 11 additions & 0 deletions test46.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class A{
public:
int f(int x, int y);
};

class B: public A{
};

class C: public A, public B{
int f(int z, int hello);
};
3 changes: 3 additions & 0 deletions test47.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A: A{
int x;
};
6 changes: 6 additions & 0 deletions test48.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class A{
int x;
};

class B: public A, private A{
};
4 changes: 4 additions & 0 deletions test49.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class A{
};

class B: C{};
Loading

0 comments on commit 54c4ace

Please sign in to comment.