From 18b5fdd72a5f653179e07b4454bcb3f8c2ba15e1 Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Fri, 8 Apr 2022 11:23:03 +0200 Subject: [PATCH] test(extendpolar): add test on correct value Signed-off-by: Thomas Lambert <t.lambert@uliege.be> --- +af_tools/extendpolar.m | 2 +- CHANGELOG.md | 9 +++++++-- tests/test_extendpolar.m | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/+af_tools/extendpolar.m b/+af_tools/extendpolar.m index d930dc2..74cb50b 100644 --- a/+af_tools/extendpolar.m +++ b/+af_tools/extendpolar.m @@ -96,7 +96,7 @@ if sign(min(alpha(:,1))) == sign(max(alpha(:,1))) end try - findstall(alpha, cl, cd) + findstall(alpha, cl, cd); catch error('MATLAB:extendpolar:noStall',['To be extended, a polar must at '... 'least contain the stall point.']); diff --git a/CHANGELOG.md b/CHANGELOG.md index 5244efa..05ad166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Initial release - ### Changed ### Deprecated @@ -20,3 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security + +## [1.0.0] - 2022-04-08 + +- Initial release + +[Unreleased]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.0.0...master +[1.0.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/releases/v1.0.0 diff --git a/tests/test_extendpolar.m b/tests/test_extendpolar.m index 1eebcb6..0c8e5fc 100644 --- a/tests/test_extendpolar.m +++ b/tests/test_extendpolar.m @@ -192,3 +192,21 @@ end %% Test if function returns expected outputs +function test_correctAlphaSize(testCase) +% Verify if the output alpha has the correct size +% Should not re-expand polar that already covers the full range + +Polar = dummysinglepolar(); +stepAlpha = min(diff(Polar.alpha)); +fullRange = (-pi:stepAlpha:pi)'; + +[alphaExt, clExt, cdExt] = af_tools.extendpolar(Polar); +[alphaExt2, clExt2, cdExt2] = af_tools.extendpolar(alphaExt, clExt, cdExt); + +verifyEqual(testCase, alphaExt, fullRange, 'AbsTol',1e-9); + +verifyEqual(testCase, alphaExt2, alphaExt); +verifyEqual(testCase, clExt2, clExt); +verifyEqual(testCase, cdExt2, cdExt); + +end -- GitLab