Skip to content
Snippets Groups Projects
Verified Commit 429beb58 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

refactor: input parser for files

parent 86ab078f
No related branches found
No related tags found
No related merge requests found
function [filenames, filepaths, idxOpts] = parsefileinputs(optList, filetype, varargin)
% PARSEFILEINPUTS Parses the input and checks their validity.
% Returns the filenames and filepaths for the input files, as well as the
% index where the remaining options start.
%
% -----
%
% Usage:
% [filenames, filepaths, idxOpts] = PARSEPOLARINPUTS (optList, filetype)
% [filenames, filepaths, idxOpts] = PARSEPOLARINPUTS (optList, filetype, ...)
% -----
% Copyright 2022 Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License
% https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox
% ------------------------------------------------------------------------------
import af_tools.utils.*
% First ensures the option list and filetype is properly set
validateattributes(optList, {'char','string','cell'},{}, mfilename(), 'optList', 1)
validateattributes(filetype, {'char','string'},{'scalartext'}, mfilename(), 'filetype', 2)
filetype = char(filetype);
if filetype(1) ~= '.'
error('MATLAB:parsefileinputs:invalidFileType', 'The filetype must starts by a point (.dat, .m, .mat, etc). Found ''%s''!\n', filetype);
end
% Constants and defaults
DEFAULT_INPUTFILES = '*';
% Parse inputs
hasNoInput = isempty(varargin) || isoption(optList, varargin{1});
if hasNoInput
% Prompt user to select files
ext = ['*',filetype];
[filenames, filepaths] = uigetfile(ext, 'Select all dat-files to aggregate', 'MultiSelect', 'on');
idxOpts = 1;
else
inputDir = varargin{1};
idxOpts = 2;
if nargin >= 4 && ~isoption(optList, varargin{2})
idxOpts = 3;
inputFiles = varargin{2};
else
inputFiles = DEFAULT_INPUTFILES;
end
% Validate inputDir
validateattributes(inputDir, {'char','string'},{'nonempty','vector'}, mfilename(), 'inputDir')
if ~exist(inputDir, 'dir')
error('MATLAB:parsefileinputs:dirNotFound', 'The directory specified as inputDir (%s) can not be found!\n', inputDir);
end
% Validate inputFiles
validateattributes(inputFiles, {'char','cell'},{'nonempty','vector'}, mfilename(), 'inputFiles', 4)
if iscell(inputFiles) && ~iscellstr(inputFiles)
error('MATLAB:parsefileinputs:wrongInputFiles', ['If inpuFiles is given as a cell array, it must '...
'contain only character vectors!\n']);
end
% ------------------------------------------------------
% Look for files
% Get absolute path
if contains(inputDir, pwd)
filepaths = inputDir;
else
filepaths = fullfile(pwd, inputDir);
end
% Convert inputFiles to string for simpler handling
inputFiles = string(inputFiles);
% Get all files
AllFiles = [];
for i = 1:length(inputFiles)
inputFiles(i) = appendextension(inputFiles(i),filetype); % Add extension
dummy = dir(fullfile(filepaths,inputFiles(i)));
if isempty(dummy)
warning('MATLAB:parsefileinputs:FileNotFound', 'Could not find file %s.', fullfile(filepaths,inputFiles(i)));
end
AllFiles = [AllFiles; dummy];
end
if isempty(AllFiles)
error('MATLAB:parsefileinputs:noFilesFound', 'Impossible to find ANY file matching the input arguments.');
end
filenames = cell(1,length(AllFiles));
for i = 1:length(AllFiles)
filenames{i} = AllFiles(i).name;
end
end
end
% ------------------------------------------------------------------------------
function bool = isoption(optList, var)
% ISOPTION Returns true if var is contained in option list
bool = any(strcmpi(var,optList));
end
......@@ -132,7 +132,7 @@ end
% ------------------------------------------------------------------------------
function [spacing, zerote, savedat] = parseoptioninputs(varargin)
% PARSEINPUTS Parses the input and checks their validity
% PARSEOPTIONINPUTS Parses the options and checks their validity
import af_tools.utils.*
......
......@@ -75,8 +75,13 @@ narginchk(0,6);
% Import other functions from this package
import af_tools.utils.*
% Constants and defaults
OPTION_LIST = {'autosave', 'overwrite'};
FILETYPE = '.dat';
% Parse inputs
[allFileNames, fullpath, autosave, overwrite] = parseinputs(varargin{:});
[allFileNames, fullpath, idxOpts] = parsefileinputs(OPTION_LIST, FILETYPE, varargin{:});
[autosave, overwrite] = parseoptioninputs(varargin{idxOpts:end});
% Convert filenames to string array
allFileNames = string(allFileNames);
......@@ -146,105 +151,24 @@ end
% ------------------------------------------------------------------------------
function [allFileNames, fullpath, autosave, overwrite] = parseinputs(varargin)
% PARSEINPUTS Parse inputs and return the list of files and options
function [autosave, overwrite] = parseoptioninputs(varargin)
% PARSEOPTIONINPUTS Parses the options and checks their validity
import af_tools.utils.*
% Constants and defaults
DEFAULT_INPUTFILES = '*'; % If not specified, all files of the dir are included by default
DEFAULT_AUTOSAVE = false; % Do not autosave by default
DEFAULT_OVERWRITE = false; % Do not overwrite files by default
OPTION_LIST = {'autosave','overwrite'};
% Parse main inputs
hasNoInput = isempty(varargin) || isoption(OPTION_LIST, varargin{1});
if hasNoInput
% Prompt user for the files to read
[allFileNames, fullpath] = uigetfile('*.dat', 'Select all dat-files to aggregate', 'MultiSelect', 'on');
idxOpts = 1;
else
inputDir = varargin{1};
idxOpts = 2;
if nargin >= 2 && ~isoption(OPTION_LIST, varargin{2})
idxOpts = 3;
inputFiles = varargin{2};
else
inputFiles = DEFAULT_INPUTFILES;
end
% Validate inputDir
validateattributes(inputDir, {'char','string'},{'nonempty','vector'}, mfilename(), 'inputDir')
if ~exist(inputDir, 'dir')
error('MATLAB:uiuccleaner:dirNotFound', ['The directory specified as inputDir (%s) can not be found!\n'], inputDir);
end
% Validate inputFiles
validateattributes(inputFiles, {'char','cell'},{'nonempty','vector'}, mfilename(), 'inputFiles', 4)
if iscell(inputFiles) && ~iscellstr(inputFiles)
error('MATLAB:uiuccleaner:wrongInputFiles', ['If inpuFiles is given as a cell array, it must '...
'contain only character vectors!\n']);
end
% ------------------------------------------------------
% Look for files
% Get absolute path
if contains(inputDir, pwd)
fullpath = inputDir;
else
fullpath = fullfile(pwd, inputDir);
end
% Convert inputFiles to string for simpler handling
inputFiles = string(inputFiles);
% Get all files
AllFiles = [];
for i = 1:length(inputFiles)
inputFiles(i) = appendextension(inputFiles(i),'.dat'); % Add extension
dummy = dir(fullfile(fullpath,inputFiles(i)));
if isempty(dummy)
warning('MATLAB:uiuccleaner:FileNotFound', 'Could not find file %s.', fullfile(fullpath,inputFiles(i)));
end
AllFiles = [AllFiles; dummy];
end
if isempty(AllFiles)
error('MATLAB:uiuccleaner:noFilesFound', 'Impossible to find ANY file matching the input arguments.');
end
allFileNames = cell(1,length(AllFiles));
for i = 1:length(AllFiles)
allFileNames{i} = AllFiles(i).name;
end
end
DEFAULT_AUTOSAVE = false;
DEFAULT_OVEWRITE = false;
% Option validator
validLogical = @(x) validateattributes(x, {'logical'},{'scalar'}, mfilename());
% Parse options
p = inputParser;
addParameter(p,'autosave', DEFAULT_AUTOSAVE, validLogical);
addParameter(p,'overwrite', DEFAULT_OVERWRITE, validLogical);
parse(p,varargin{idxOpts:end});
addParameter(p,'autosave',DEFAULT_AUTOSAVE, validLogical);
addParameter(p,'overwrite',DEFAULT_OVEWRITE, validLogical);
parse(p,varargin{:});
autosave = p.Results.autosave;
overwrite = p.Results.overwrite;
end
% ------------------------------------------------------------------------------
function bool = isoption(optList, var)
% ISOPTION Returns true if var is contained in option list
bool = any(strcmpi(var,optList));
end
......@@ -88,8 +88,13 @@ import af_tools.utils.*
AUTONAME = true; % Name saved file automatically
PREVENT_OVERWRITING = true; % Prevents overwriting of the files during autosave
OPTION_LIST = {'autosave', 'trimAoas'};
FILETYPE = '.txt';
% Parse inputs
[allFileNames, fullpath, autosave, trimAoas] = parseinputs(varargin{:});
[allFileNames, fullpath, idxOpts] = parsefileinputs(OPTION_LIST, FILETYPE, varargin{:});
[autosave, trimAoas] = parseoptioninputs(varargin{idxOpts:end});
% Convert filenames to string array
allFileNames = string(allFileNames);
......@@ -233,87 +238,16 @@ end
end
% ------------------------------------------------------------------------------
function [allFileNames, fullpath, autosave, trimAoas] = parseinputs(varargin)
% PARSEINPUTS Parse inputs and return the list of files and options
function [autosave, trimAoas] = parseoptioninputs(varargin)
% PARSEOPTIONINPUTS Parses the options and checks their validity
import af_tools.utils.*
% Constants and defaults
DEFAULT_INPUTFILES = '*'; % If not specified, all files of the dir are included by default
DEFAULT_AUTOSAVE = false; % Do not autosave by default
DEFAULT_TRIMAOAS = false; % Do not trim AOAs by default
OPTION_LIST = {'autosave','trimAoas'};
% Parse main inputs
hasNoInput = isempty(varargin) || isoption(OPTION_LIST, varargin{1});
if hasNoInput
% Prompt user for the files to read
[allFileNames, fullpath] = uigetfile('*.txt', ['Select all XFOIL files to aggregate'], 'MultiSelect', 'on','textFiles');
idxOpts = 1;
else
inputDir = varargin{1};
idxOpts = 2;
if nargin >= 2 && ~isoption(OPTION_LIST, varargin{2})
idxOpts = 3;
inputFiles = varargin{2};
else
inputFiles = DEFAULT_INPUTFILES;
end
% Validate inputDir
validateattributes(inputDir, {'char','string'},{'nonempty','vector'}, mfilename(), 'inputDir')
if ~exist(inputDir, 'dir')
error('MATLAB:xf2mat:dirNotFound', ['The directory specified as inputDir (%s) can not be found!\n'], inputDir);
end
% Validate inputFiles
validateattributes(inputFiles, {'char','cell'},{'nonempty','vector'}, mfilename(), 'inputFiles', 4)
if iscell(inputFiles) && ~iscellstr(inputFiles)
error('MATLAB:xf2mat:wrongInputFiles', ['If inpuFiles is given as a cell array, it must '...
'contain only character vectors!\n']);
end
% ------------------------------------------------------
% Look for files
% Get absolute path
if contains(inputDir, pwd)
fullpath = inputDir;
else
fullpath = fullfile(pwd, inputDir);
end
% Convert inputFiles to string for simpler handling
inputFiles = string(inputFiles);
% Get all files
AllFiles = [];
for i = 1:length(inputFiles)
inputFiles(i) = appendextension(inputFiles(i),'.txt'); % Add extension
dummy = dir(fullfile(fullpath,inputFiles(i)));
if isempty(dummy)
warning('MATLAB:xf2mat:FileNotFound', 'Could not find file %s.', fullfile(fullpath,inputFiles(i)));
end
AllFiles = [AllFiles; dummy];
end
if isempty(AllFiles)
error('MATLAB:xf2mat:noFilesFound', 'Impossible to find ANY file matching the input arguments.');
end
allFileNames = cell(1,length(AllFiles));
for i = 1:length(AllFiles)
allFileNames{i} = AllFiles(i).name;
end
end
% Option validator
validLogical = @(x) validateattributes(x, {'logical'},{'scalar'}, mfilename());
......@@ -322,21 +256,13 @@ validLogical = @(x) validateattributes(x, {'logical'},{'scalar'}, mfilename());
p = inputParser;
addParameter(p,'autosave', DEFAULT_AUTOSAVE, validLogical);
addParameter(p,'trimAoas', DEFAULT_TRIMAOAS, validLogical);
parse(p,varargin{idxOpts:end});
parse(p,varargin{:});
autosave = p.Results.autosave;
trimAoas = p.Results.trimAoas;
end
% ------------------------------------------------------------------------------
function bool = isoption(optList, var)
% ISOPTION Returns true if var is contained in option list
bool = any(strcmpi(var,optList));
end
% ------------------------------------------------------------------------------
function aoaRange = findcommonrange(aoaRange, resArray)
% FINDCOMMONRANGE Find the best common range accors all polars
......
% TEST_PARSEFILEINPUTS Unitary tests for the parsefileinputs sub-function
% Note:
% Matlab package functionality is not very test-framework friendly.
% Either the whole package has to be imported in EVERY SINGLE TEST or the
% functions must be called as <package>.function() everytime.
% The second option is preferred for the tests as it has the smaller scope.
% -----
% Copyright 2022 Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License
% https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox
% ------------------------------------------------------------------------------
%% Main test function
function tests = test_parsefileinputs
tests = functiontests(localfunctions);
end
%% Setup and teardown
function setupOnce(testCase)
addpath('../.'); % Add repository to Matlab Path
addpath('./test_utils'); % Add utils to Matlab Path
% Set random number generator settings
testCase.TestData.currentRNG = rng;
end
function teardownOnce(testCase)
rmpath('../.'); % Remove repository from Matlab Path
rmpath('./test_utils'); % Remove utils from Matlab Path
% Restore the random number generator settings
s = testCase.TestData.currentRNG;
rng(s)
end
function teardown(~)
close all; % Close all figures that would have been openend
end
%% Check if errors and warnings are raised
function test_invalidOptsList(testCase)
% Error if optList is not a cell array or a string array
empty = [];
scal = 0;
logi = true;
% OptList must be a char, string or cell array
verifyError(testCase, @() af_tools.utils.parsefileinputs(empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(logi), 'MATLAB:parsefileinputs:invalidType')
end
function test_invalidFiletype(testCase)
% Error if filetype does not start with a point
EMPTY_OPTS = {};
wrongFt = 'dat';
% OptList must be a char, string or cell array
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS,wrongFt), 'MATLAB:parsefileinputs:invalidFileType')
end
function test_invalidInputTypeWhenNoOpts(testCase)
% Error if any input is of the wrong type
EMPTY_OPTS = {};
FILETYPE = '.dat';
empty = [];
scal = 0;
logi = true;
Struct = struct;
% 1. inputDir (char vector or string)
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, Struct), 'MATLAB:parsefileinputs:invalidType')
% 2. inputFile (char, string, cell of chars)
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, scal, empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, scal, scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, scal, logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, scal, Struct), 'MATLAB:parsefileinputs:invalidType')
end
% -------------------------------------
function test_dirNotFound(testCase)
% Error if valid inputDir not found
EMPTY_OPTS = {};
FILETYPE = '.dat';
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, 'missingdir'), 'MATLAB:parsefileinputs:dirNotFound')
end
function test_fileNotFound(testCase)
% Error if valid inputDir not found
EMPTY_OPTS = {'test'};
FILETYPE = '.dat';
testdir = [pwd,'/test_utils'];
verifyWarning(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, testdir, {'clarky.dat','testdummy.dat'}), 'MATLAB:parsefileinputs:FileNotFound')
warning('off','MATLAB:parsefileinputs:FileNotFound') % remove warning first warning about FileNotFound before it throws the error
verifyError(testCase, @() af_tools.utils.parsefileinputs(EMPTY_OPTS, FILETYPE, testdir, 'randomFile'), 'MATLAB:parsefileinputs:noFilesFound')
warning on % Reactivate warnings
end
......@@ -72,17 +72,17 @@ scal = 0;
logi = true;
Struct = struct;
% 1. InputDir (char vector or string)
verifyError(testCase, @() af_tools.uiuccleaner(empty), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(logi), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(Struct), 'MATLAB:uiuccleaner:invalidType')
% 2. cl (numeric)
verifyError(testCase, @() af_tools.uiuccleaner(scal, empty), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, scal), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, logi), 'MATLAB:uiuccleaner:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, Struct), 'MATLAB:uiuccleaner:invalidType')
% 1. inputDir (char vector or string)
verifyError(testCase, @() af_tools.uiuccleaner(empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(Struct), 'MATLAB:parsefileinputs:invalidType')
% 2. inputFile (char, string, cell of chars)
verifyError(testCase, @() af_tools.uiuccleaner(scal, empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.uiuccleaner(scal, Struct), 'MATLAB:parsefileinputs:invalidType')
end
......@@ -131,7 +131,7 @@ end
function test_dirNotFound(testCase)
% Error if valid inputDir not found
verifyError(testCase, @() af_tools.uiuccleaner('missingdir'), 'MATLAB:uiuccleaner:dirNotFound')
verifyError(testCase, @() af_tools.uiuccleaner('missingdir'), 'MATLAB:parsefileinputs:dirNotFound')
end
......@@ -141,9 +141,9 @@ function test_fileNotFound(testCase)
testdir = [pwd,'/test_utils'];
verifyWarning(testCase, @() af_tools.uiuccleaner(testdir, {'clarky.dat','testdummy.dat'}), 'MATLAB:uiuccleaner:FileNotFound')
warning('off','MATLAB:uiuccleaner:FileNotFound') % remove warning first warning about FileNotFound before it throws the error
verifyError(testCase, @() af_tools.uiuccleaner(testdir, 'randomFile'), 'MATLAB:uiuccleaner:noFilesFound')
verifyWarning(testCase, @() af_tools.uiuccleaner(testdir, {'clarky.dat','testdummy.dat'}), 'MATLAB:parsefileinputs:FileNotFound')
warning('off','MATLAB:parsefileinputs:FileNotFound') % remove warning first warning about FileNotFound before it throws the error
verifyError(testCase, @() af_tools.uiuccleaner(testdir, 'randomFile'), 'MATLAB:parsefileinputs:noFilesFound')
warning on % Reactivate warnings
end
......
......@@ -72,17 +72,17 @@ scal = 0;
logi = true;
Struct = struct;
% 1. InputDir (char vector or string)
verifyError(testCase, @() af_tools.xf2mat(empty), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(logi), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(Struct), 'MATLAB:xf2mat:invalidType')
% 2. cl (numeric)
verifyError(testCase, @() af_tools.xf2mat(scal, empty), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, scal), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, logi), 'MATLAB:xf2mat:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, Struct), 'MATLAB:xf2mat:invalidType')
% 1. inputDir (char vector or string)
verifyError(testCase, @() af_tools.xf2mat(empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(Struct), 'MATLAB:parsefileinputs:invalidType')
% 2. inputFile (char, string, cell of chars)
verifyError(testCase, @() af_tools.xf2mat(scal, empty), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, scal), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, logi), 'MATLAB:parsefileinputs:invalidType')
verifyError(testCase, @() af_tools.xf2mat(scal, Struct), 'MATLAB:parsefileinputs:invalidType')
end
......@@ -131,7 +131,7 @@ end
function test_dirNotFound(testCase)
% Error if valid inputDir not found
verifyError(testCase, @() af_tools.xf2mat('missingdir'), 'MATLAB:xf2mat:dirNotFound')
verifyError(testCase, @() af_tools.xf2mat('missingdir'), 'MATLAB:parsefileinputs:dirNotFound')
end
......@@ -141,9 +141,9 @@ function test_fileNotFound(testCase)
testdir = [pwd,'/test_utils'];
verifyWarning(testCase, @() af_tools.xf2mat(testdir, {'xflr*','randomFile'}), 'MATLAB:xf2mat:FileNotFound')
warning('off','MATLAB:xf2mat:FileNotFound') % remove warning first warning about FileNotFound before it throws the error
verifyError(testCase, @() af_tools.xf2mat(testdir, 'randomFile'), 'MATLAB:xf2mat:noFilesFound')
verifyWarning(testCase, @() af_tools.xf2mat(testdir, {'xflr*','randomFile'}), 'MATLAB:parsefileinputs:FileNotFound')
warning('off','MATLAB:parsefileinputs:FileNotFound') % remove warning first warning about FileNotFound before it throws the error
verifyError(testCase, @() af_tools.xf2mat(testdir, 'randomFile'), 'MATLAB:parsefileinputs:noFilesFound')
warning on % Reactivate warnings
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment