Skip to content

Commit

Permalink
oprava chyby v teste 015, pridane 3 testy na kontrolu using, hlavne n…
Browse files Browse the repository at this point in the history
…a stavy kde instacie maju rovnake meno ako metody a pretazovanie metod
  • Loading branch information
marusak committed Apr 8, 2016
1 parent 55c58ed commit 69911c3
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 1 deletion.
11 changes: 11 additions & 0 deletions _stud_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,17 @@ echo -n $? > ${LOG_PATH}test031D.!!!
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test032.in --output=${LOCAL_OUT_PATH2}test032.out 2> ${LOG_PATH}test032.err
echo -n $? > ${LOG_PATH}test032.!!!

# test33: one using on more fethods: test033.out; Expected return code: 0
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test033.in --output=${LOCAL_OUT_PATH2}test033.out --details=C 2> ${LOG_PATH}test033.err
echo -n $? > ${LOG_PATH}test033.!!!

# test34: instance name and method name cannot be the same: test034.out; Expected return code: 21
$INTERPRETER $TASK.$EXTENSION --input=${LOCAL_IN_PATH}test034.in --output=${LOCAL_OUT_PATH2}test034.out 2> ${LOG_PATH}test034.err
echo -n $? > ${LOG_PATH}test034.!!!

# test35: instance name and method name cannot be the same when in base classes: test035.out; Expected return code: 21
$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.!!!

#Print results
RED='\033[0;31m'
Expand Down
1 change: 1 addition & 0 deletions ref-out/test033.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
32 changes: 32 additions & 0 deletions ref-out/test033.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<class kind="concrete" name="C">
<inheritance>
<from name="B" privacy="public"/>
<from name="A" privacy="public"/>
</inheritance>
<public>
<methods>
<method name="f" scope="instance" type="int">
<from name="B"/>
<arguments>
<argument name="a" type="int"/>
</arguments>
</method>
<method name="f1" scope="instance" type="int">
<from name="B"/>
<arguments/>
</method>
<method name="f2" scope="instance" type="int">
<from name="A"/>
<arguments/>
</method>
<method name="f" scope="instance" type="int">
<from name="B"/>
<arguments>
<argument name="a" type="int"/>
<argument name="b" type="int"/>
</arguments>
</method>
</methods>
</public>
</class>
1 change: 1 addition & 0 deletions ref-out/test034.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Empty file added ref-out/test034.out
Empty file.
1 change: 1 addition & 0 deletions ref-out/test035.!!!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21
Empty file added ref-out/test035.out
Empty file.
2 changes: 1 addition & 1 deletion test015.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public:
int function(int x, int y);
};
class D : protected B, C {
using C::function(int x, int y);
using C::function;
};
18 changes: 18 additions & 0 deletions test033.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class A{
public:
int f(int a, int b);
int f(int a);
int f2(void);
};

class B{
public:
int f(int a, int b);
int f(int a);
int f1(void);
};

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

class B{
public:
int f;
};

class C: A, B{
};

0 comments on commit 69911c3

Please sign in to comment.