Skip to content

Commit

Permalink
Re #356 Simplifying test_IX_aperture.m class according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Oct 20, 2021
1 parent c8a1b2b commit 7cea407
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions _test/test_instrument_classes/test_IX_aperture.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,8 @@
%--------------------------------------------------------------------------
function self = test_IX_aperture (varargin)

self@TestCaseWithSave(varargin{:});
test_files_folder = fileparts(mfilename('fullpath'));
if nargin> 0
is = ismember(varargin,'-save');
if any(is)
if numel(is)>2
error('HERBERT:test_IX_apperture:invalid_argument',...
'the test can be called only with one or two parameters')
elseif numel(is)==1
filename = 'test_IX_aperture_output.mat';
else
filename = varargin{~is};
end
opt = '-save';
params={opt,filename};
else
params= varargin(1);
end
else
params= {'test_IX_aperture'};
end
self@TestCaseWithSave(params{:});
self.home_folder = test_files_folder;
%does nothing unless the constructor called with '-save' key
self.save()
Expand Down Expand Up @@ -73,7 +54,7 @@ function test_aperture_array_prev_versions(obj)
% 2x2 array example
ap_arr = [IX_aperture('Ap0', 11, 0.2, 0.25), IX_aperture('Ap1', 121, 0.22, 0.225);...
IX_aperture('Ap3', 311, 0.23, 0.325), IX_aperture('Ap4', 114, 0.24, 0.245)];
sample_file_location = obj.home_folder;
sample_file_location = obj.home_folder;
if obj.save_output % prepare test data for the future.
% move test data to data folder manually
% run test_IX_apperture with -save option to obtain reference
Expand Down Expand Up @@ -102,8 +83,8 @@ function test_single_aperture_load_prev_versions(obj)
ap = IX_aperture ('Ap0', 11, 0.2, 0.25);
sample_files_location = obj.home_folder;
if obj.save_output
% run test_IX_apperture with -save option to obtain reference
% files when changed to new class version
% run test_IX_apperture with -save option to obtain reference
% files when changed to new class version
save_variables=true;
ver = ap.classVersion();
verstr = ['ver',num2str(ver)];
Expand Down

0 comments on commit 7cea407

Please sign in to comment.