forked from tjhickey724/OctaveBat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_scores100.m
50 lines (28 loc) · 960 Bytes
/
test_scores100.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Tarif Riyad Rahman
% MATLAB syntax used
% This is the test bed for the function commonTwo
% sample cases are used for testing the correctness of the function
% All test cases added by Tarif Riyad Rahman. New test bed for new test cases
function e=test_scores100()
e=0;
e=e+runtest([100 100 1],1);
e=e+runtest([3],0);
e=e+runtest([6,6,10],0);
e=e+runtest([100,100,10],1);
e=e+runtest([100,100,5],1);
e=e+runtest([100 34 5 2],0);
e=e+runtest([2 2 1],0);
e=e+runtest([0 100 7],0);
e=e+runtest([8 100 100],1);
e=e+runtest([23,34,22],0);
end
function e=runtest(numArray,answer)
result=scores100(numArray);
if result==answer
e=0;
disp(['scores100(',num2str(numArray),')==',num2str(answer)]);
else
e=1;
disp(['scores100(',num2str(numArray),')==',num2str(result),'<>',num2str(answer)]);
end
end