Fixed unit test (false negative in Octave testsuite).

parent ac3af205
...@@ -82,7 +82,7 @@ return ...@@ -82,7 +82,7 @@ return
%@test:1 %@test:1
% Write a data file % Write a data file
fid = fopen('example.m','w'); fid = fopen('example1.m','w');
fwriten(fid, 'a = randn(100,1);'); fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);'); fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));'); fwriten(fid, 'c = transpose(randn(100,1));');
...@@ -98,8 +98,8 @@ fclose(fid); ...@@ -98,8 +98,8 @@ fclose(fid);
listofvariablestobeloaded = {'b', 'a'}; listofvariablestobeloaded = {'b', 'a'};
% Test if we can load the data. % Test if we can load the data.
try try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded); data = load_m_file_data_legacy('example1.m', listofvariablestobeloaded);
delete example.m delete('example1.m');
t(1) = 1; t(1) = 1;
catch catch
t(1) = 0; t(1) = 0;
...@@ -109,7 +109,7 @@ T = all(t); ...@@ -109,7 +109,7 @@ T = all(t);
%@test:2 %@test:2
% Write a data file % Write a data file
fid = fopen('example.m','w'); fid = fopen('example2.m','w');
fwriten(fid, 'a = randn(100,1);'); fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);'); fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));'); fwriten(fid, 'c = transpose(randn(100,1));');
...@@ -125,8 +125,8 @@ fclose(fid); ...@@ -125,8 +125,8 @@ fclose(fid);
listofvariablestobeloaded = {'e', 'a'}; listofvariablestobeloaded = {'e', 'a'};
% Test if we can load the data. % Test if we can load the data.
try try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded); data = load_m_file_data_legacy('example2.m', listofvariablestobeloaded);
delete example.m delete('example2.m');
t(1) = 0; t(1) = 0;
catch catch
t(1) = 1; t(1) = 1;
...@@ -136,7 +136,7 @@ T = all(t); ...@@ -136,7 +136,7 @@ T = all(t);
%@test:3 %@test:3
% Write a data file % Write a data file
fid = fopen('example.m','w'); fid = fopen('example3.m','w');
fwriten(fid, 'a = randn(100,1);'); fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);'); fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));'); fwriten(fid, 'c = transpose(randn(100,1));');
...@@ -152,8 +152,8 @@ fclose(fid); ...@@ -152,8 +152,8 @@ fclose(fid);
listofvariablestobeloaded = {'c', 'a'}; listofvariablestobeloaded = {'c', 'a'};
% Test if we can load the data. % Test if we can load the data.
try try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded); data = load_m_file_data_legacy('example3.m', listofvariablestobeloaded);
delete example.m delete('example3.m');
t(1) = 1; t(1) = 1;
catch catch
t(1) = 0; t(1) = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment