Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matlab_airfoil_toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
matlab_airfoil_toolbox
Commits
6d74c642
Verified
Commit
6d74c642
authored
3 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
test: add tests for selig and lednicer
parent
e57ca58e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#6229
passed
2 years ago
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
tests/test_lednicer.m
+69
-0
69 additions, 0 deletions
tests/test_lednicer.m
tests/test_selig.m
+69
-0
69 additions, 0 deletions
tests/test_selig.m
with
140 additions
and
0 deletions
CHANGELOG.md
+
2
−
0
View file @
6d74c642
...
...
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-
Unit tests for
**utils.selig**
and
**utils.lednicer**
### Changed
### Deprecated
...
...
This diff is collapsed.
Click to expand it.
tests/test_lednicer.m
0 → 100644
+
69
−
0
View file @
6d74c642
% TEST_LEDNICER Unitary tests for the lednicer 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.
%
% -----
% (c) Copyright 2022 University of Liege
% Author: 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_lednicer
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
%% Test for correct output
function
test_scalar
(
testCase
)
% If input is scalar, output should be same scalar
x
=
(
0
:
0.1
:
1
)
'
;
yup
=
x
;
ylow
=
-
x
;
upper
=
[
x
,
yup
];
lower
=
[
x
,
ylow
];
coord
=
af_tools
.
utils
.
lednicer
(
upper
,
lower
);
verifyEqual
(
testCase
,
coord
,
[
upper
;
lower
]);
end
This diff is collapsed.
Click to expand it.
tests/test_selig.m
0 → 100644
+
69
−
0
View file @
6d74c642
% TEST_SELIG Unitary tests for the selig 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.
%
% -----
% (c) Copyright 2022 University of Liege
% Author: 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_selig
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
%% Test for correct output
function
test_scalar
(
testCase
)
% If input is scalar, output should be same scalar
x
=
(
0
:
0.1
:
1
)
'
;
yup
=
x
;
ylow
=
-
x
;
upper
=
[
x
,
yup
];
lower
=
[
x
,
ylow
];
coord
=
af_tools
.
utils
.
selig
(
upper
,
lower
);
verifyEqual
(
testCase
,
coord
,
[
flipud
(
upper
);
lower
(
2
:
end
,
:)]);
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment