-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #356 working serializable class, modified IX_aperture and unit tes…
…ts for it and its previous versions
- Loading branch information
Showing
19 changed files
with
149 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function [ok,mess] = check_matfile_IO (ver_str, save_variables, filepath,varargin) | ||
% Save to or read from mat file | ||
% input | ||
% ver_str -- the name of the version string e.g. ver0 for old | ||
% version ver1 for version 1 etc | ||
% save_variables -- if true, saves sample variables, if false load | ||
% them from disk | ||
% filepath -- the location of source test files on hdd. | ||
% If the routine writes to disk, it writes | ||
% test files into temporarty directory | ||
% varargin -- variables to save/load on hdd | ||
mess = ''; | ||
ok = true; | ||
for i=1:numel(varargin) | ||
class_name = class(varargin{i}); | ||
arg_name = inputname(i+3); | ||
flname = [ver_str,'_',class_name,'_',arg_name,'.mat']; | ||
if save_variables | ||
eval([arg_name,' = varargin{i};']); | ||
try | ||
save(fullfile(tmp_dir,flname),arg_name); | ||
catch | ||
mess=['*** ERROR: Problem writing ',arg_name,' to ',flname]; | ||
ok = false; | ||
end | ||
else | ||
tmp = load(fullfile(filepath,'saved_class_versions_as_mat_files',flname),arg_name); | ||
if ~isequal(varargin{i},tmp.(arg_name)) | ||
ok = false; | ||
mess=['*** ERROR: Argument ''',arg_name,''' read from ',flname,' does not match original']; | ||
end | ||
end | ||
end |
Binary file added
BIN
+591 Bytes
_test/test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_aperture_ap.mat
Binary file not shown.
Binary file added
BIN
+733 Bytes
_test/test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_aperture_ap_arr.mat
Binary file not shown.
Binary file added
BIN
+1.17 KB
...t_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_divergence_profile_div.mat
Binary file not shown.
Binary file added
BIN
+7.33 KB
...strument_classes/saved_class_versions_as_mat_files/ver1_IX_divergence_profile_div_arr.mat
Binary file not shown.
Binary file added
BIN
+2.57 KB
..._instrument_classes/saved_class_versions_as_mat_files/ver1_IX_doubledisk_chopper_disk.mat
Binary file not shown.
Binary file added
BIN
+6.27 KB
...trument_classes/saved_class_versions_as_mat_files/ver1_IX_doubledisk_chopper_disk_arr.mat
Binary file not shown.
Binary file added
BIN
+848 Bytes
...test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_fermi_chopper_fermi.mat
Binary file not shown.
Binary file added
BIN
+1.22 KB
..._instrument_classes/saved_class_versions_as_mat_files/ver1_IX_fermi_chopper_fermi_arr.mat
Binary file not shown.
Binary file added
BIN
+6.65 KB
...test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_moderator_moderator.mat
Binary file not shown.
Binary file added
BIN
+24.3 KB
..._instrument_classes/saved_class_versions_as_mat_files/ver1_IX_moderator_moderator_arr.mat
Binary file not shown.
Binary file added
BIN
+1.18 KB
_test/test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_sample_sample.mat
Binary file not shown.
Binary file added
BIN
+1.7 KB
...t/test_instrument_classes/saved_class_versions_as_mat_files/ver1_IX_sample_sample_arr.mat
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.