Quick fix to make it possible to run MATLAB tests multiple times.
I'm not sure why this is necessary. Should look into object lifetimes in MATLAB to see if there's a valid reason for the second & subsequent test runs to fail when using automatic socket management.
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
addpath('../../MATLAB')
|
||||||
|
import XPlaneConnect.*
|
||||||
|
|
||||||
testsPassed=0;
|
testsPassed=0;
|
||||||
testsFailed=0;
|
testsFailed=0;
|
||||||
if ismac()
|
if ismac()
|
||||||
@@ -22,6 +25,7 @@ theTests = {{@openCloseTest, 'Open/Close Test', 0},...
|
|||||||
{@pauseTest,'Pause Test', 0},...
|
{@pauseTest,'Pause Test', 0},...
|
||||||
{@setConnTest, 'setConn Test', 0}};
|
{@setConnTest, 'setConn Test', 0}};
|
||||||
|
|
||||||
|
socket = openUDP();
|
||||||
for i=1:length(theTests)
|
for i=1:length(theTests)
|
||||||
fprintf(['Test ',num2str(i),': ',theTests{i}{2},' - ']);
|
fprintf(['Test ',num2str(i),': ',theTests{i}{2},' - ']);
|
||||||
try
|
try
|
||||||
@@ -36,6 +40,7 @@ for i=1:length(theTests)
|
|||||||
testsFailed = testsFailed + 1;
|
testsFailed = testsFailed + 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
closeUDP(socket);
|
||||||
|
|
||||||
disp('Results Summary:');
|
disp('Results Summary:');
|
||||||
fprintf('Passed: %i\tFailed: %i\n',testsPassed, testsFailed);
|
fprintf('Passed: %i\tFailed: %i\n',testsPassed, testsFailed);
|
||||||
Reference in New Issue
Block a user