Skip to content

Commit

Permalink
fix(tests): miscelaneous docstring fixes
Browse files Browse the repository at this point in the history
This fixes some docstrings related issues:

1. Remove leading whitespaces in some places
2. avoid displaying output of some test assignments
3. avoid nested execution of `xunit` tests
when `checkDocstrings` hits the `runAllTests` routine.
4. Fix wrong parameter file in
`detectMappingDelimiter` docstring.
5. Fix wrong function reference in
`IMOS.meta.site_bathymetry` docstring.
  • Loading branch information
ocehugo committed Jun 10, 2021
1 parent 72db8ec commit dd14010
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Util/+IMOS/+meta/site_bathymetry.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
% Example:
% sample_data.site_nominal_depth = [];
% sample_data.site_depth_at_deployment = [];
% assert(isempty(IMOS.meta.get_site_bathymetry(sample_data)))
% assert(isempty(IMOS.meta.site_bathymetry(sample_data)))
% sample_data.site_nominal_depth = 20;
% assert(IMOS.meta.get_site_bathymetry(sample_data)==20)
% assert(IMOS.meta.site_bathymetry(sample_data)==20)
% sample_data.site_depth_at_deployment = 10;
% assert(IMOS.meta.get_site_bathymetry(sample_data)==10)
% assert(IMOS.meta.site_bathymetry(sample_data)==10)
%
% author: hugo.oliveira@utas.edu.au
%
Expand Down
4 changes: 2 additions & 2 deletions Util/TestUtils/checkDocstrings.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
% Check all matlab source file IMOS docstrings in a folder.
%
% Inputs:
%
%
% folder [str] - a string with the folder location.
%
% Outputs:
%
%
% ok [bool] - All docstrings are fine.
% wrong_files - A cell where the evaluation of the docstring failed.
%
Expand Down
6 changes: 3 additions & 3 deletions Util/detectMappingDelimiter.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% %basic usage
% comma_file = [toolboxRootPath 'GUI/instrumentAliases.txt'];
% assert(isequal(detectMappingDelimiter(comma_file),','))
% equal_file = [toolboxRootPath 'AutomaticQC/imosEchoIntensityQC.txt'];
% equal_file = [toolboxRootPath 'AutomaticQC/imosEchoIntensitySetQC.txt'];
% assert(isequal(detectMappingDelimiter(equal_file),'='))
%
%
Expand All @@ -38,7 +38,7 @@
catch
end

try
try
equal_opts = readMappings(fname,'=');
equal_ok = true;
catch
Expand All @@ -53,7 +53,7 @@
return
elseif comma_ok
delimiter = ',';
elseif equal_ok
elseif equal_ok
delimiter = '=';
end

Expand Down
10 changes: 5 additions & 5 deletions Util/memuse.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
%
% Example:
%
% x = memuse(1048576,'logical')
% x = memuse(1048576,'logical');
% assert(x==1)
% x = memuse(1048576,'double')
% x = memuse(1048576,'double');
% assert(x==8)
% x = memuse(1048576,'single')
% x = memuse(1048576,'single');
% assert(x==4)
%
% %we dont introspect content for cells/struct
% x = memuse(1,'struct')
% x = memuse(1,'struct');
% assert(isinf(x))
% x = memuse(1,'cell')
% x = memuse(1,'cell');
% assert(isinf(x))
%
%
Expand Down
2 changes: 1 addition & 1 deletion test/runAllTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%
%
% Example:
% runAllTests(1);
% %runAllTests(0);
%
% author: hugo.oliveira@utas.edu.au
%
Expand Down

0 comments on commit dd14010

Please sign in to comment.