Skip to content

Commit

Permalink
[MATLAB] Issue #67 Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Jun 2, 2016
1 parent 5d3770e commit 6875667
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 46 deletions.
26 changes: 13 additions & 13 deletions Examples/test-suite/enum_thorough.i
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,33 @@ const SpeedClass::speed & speedTest5(const SpeedClass::speed &s) { return s

typedef enum { NamedAnon1, NamedAnon2 } namedanon;

namedanon namedanonTest1(namedanon e) { return e; }
namedanon namedanonTest1(namedanon e) { return e; }

typedef enum twonamestag { TwoNames1, TwoNames2, TwoNames3 = 33 } twonames;

twonames twonamesTest1(twonames e) { return e; }
twonamestag twonamesTest2(twonamestag e) { return e; }
enum twonamestag twonamesTest3(enum twonamestag e) { return e; }
twonames twonamesTest1(twonames e) { return e; }
twonamestag twonamesTest2(twonamestag e) { return e; }
enum twonamestag twonamesTest3(enum twonamestag e) { return e; }

struct TwoNamesStruct {
typedef enum twonamestag { TwoNamesStruct1, TwoNamesStruct2 } twonames;
twonames twonamesTest1(twonames e) { return e; }
twonamestag twonamesTest2(twonamestag e) { return e; }
enum twonamestag twonamesTest3(enum twonamestag e) { return e; }
twonames twonamesTest1(twonames e) { return e; }
twonamestag twonamesTest2(twonamestag e) { return e; }
enum twonamestag twonamesTest3(enum twonamestag e) { return e; }
};

namespace AnonSpace{
typedef enum { NamedAnonSpace1, NamedAnonSpace2 } namedanonspace;
namedanonspace namedanonspaceTest1(namedanonspace e) { return e; }
AnonSpace::namedanonspace namedanonspaceTest2(AnonSpace::namedanonspace e) { return e; }
namedanonspace namedanonspaceTest1(namedanonspace e) { return e; }
AnonSpace::namedanonspace namedanonspaceTest2(AnonSpace::namedanonspace e) { return e; }
}
AnonSpace::namedanonspace namedanonspaceTest3(AnonSpace::namedanonspace e) { return e; }
AnonSpace::namedanonspace namedanonspaceTest3(AnonSpace::namedanonspace e) { return e; }
using namespace AnonSpace;
namedanonspace namedanonspaceTest4(namedanonspace e) { return e; }
namedanonspace namedanonspaceTest4(namedanonspace e) { return e; }


template<typename T> struct TemplateClass {
enum scientists { einstein, galileo = 10 };
enum scientists { einstein, galileo = 10 };
typedef enum scientists scientiststd1;
typedef scientists scientiststd2;
typedef scientiststd1 scientiststd3;
Expand Down Expand Up @@ -160,7 +160,7 @@ const TemplateClass<int>::scientiststd3 & scientistsTest8(const TemplateClass<

namespace Name {
template<typename T> struct TClass {
enum scientists { faraday, bell = 20 };
enum scientists { faraday, bell = 20 };
typedef enum scientists scientiststd1;
typedef scientists scientiststd2;
typedef scientiststd1 scientiststd3;
Expand Down
2 changes: 0 additions & 2 deletions Examples/test-suite/matlab/abstract_access_runme.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import abstract_access.*

d = abstract_access.D();
if (d.do_x() ~= 1)
error('FAILED!!')
Expand Down
9 changes: 1 addition & 8 deletions Examples/test-suite/matlab/abstract_typedef2_runme.m
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
import abstract_typedef2.*

a = A_UF();





a = abstract_typedef2.A_UF();
10 changes: 3 additions & 7 deletions Examples/test-suite/matlab/abstract_typedef_runme.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import abstract_typedef.*
e = Engine();
e = abstract_typedef.Engine();

a = abstract_typedef.A();

a = A();


if (a.write(e) ~= 1)
error('FAILED!!')
end



8 changes: 2 additions & 6 deletions Examples/test-suite/matlab/abstract_virtual_runme.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import abstract_virtual.*


d = D();

e = E();
d = abstract_virtual.D();

e = abstract_virtual.E();
15 changes: 5 additions & 10 deletions Examples/test-suite/matlab/array_member_runme.m
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import array_member.*

f = Foo();
f.data = global_data();
f = array_member.Foo();
f.data = array_member.global_data();

for i=0:7,
if (get_value(f.data,i) ~= get_value(global_data,i))
if (array_member.get_value(f.data,i) ~= array_member.get_value(array_member.global_data,i))
error('Bad array assignment');
end
end

for i=0:7,
set_value(f.data,i,-i);
array_member.set_value(f.data,i,-i);
end

global_data = f.data;

for i=0:7,
if (get_value(f.data,i) ~= get_value(global_data,i))
if (array_member.get_value(f.data,i) ~= array_member.get_value(global_data,i))
error('Bad array assignment')
end
end



0 comments on commit 6875667

Please sign in to comment.