From: Bertrand <bco...@us...> - 2016-05-22 16:49:37
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26154/tests Modified Files: CMakeLists.txt Added Files: TestAeroFuncOutput.py Log Message: Added a new test case that checks that the aerodynamics forces are consistent with the aerodynamics functions output --- NEW FILE --- # TestAeroFuncOutput.py # # Check that the aerodynamics forces are consistent with the aerodynamics # functions output # # Copyright (c) 2016 Bertrand Coconnier # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, see <http://www.gnu.org/licenses/> # import pandas as pd from JSBSim_utils import JSBSimTestCase, RunTest, CreateFDM class TestAeroFuncOutput(JSBSimTestCase): def testDragFunctions(self): fdm = CreateFDM(self.sandbox) self.script_path = self.sandbox.path_to_jsbsim_file('scripts', 'x153.xml') fdm.load_script(self.script_path) fdm.set_output_directive(self.sandbox.path_to_jsbsim_file('tests', 'output.xml')) fdm.run_ic() while fdm.run(): pass results = pd.read_csv('output.csv', index_col=0) Fdrag = results['F_{Drag} (lbs)'] CDmin = results['aero/coefficient/CDmin'] CDi = results['aero/coefficient/CDi'] self.assertAlmostEqual(abs(Fdrag/(CDmin+CDi)).max(), 1.0, delta=1E-5) RunTest(TestAeroFuncOutput) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/CMakeLists.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** CMakeLists.txt 16 May 2016 17:29:46 -0000 1.27 --- CMakeLists.txt 22 May 2016 16:49:34 -0000 1.28 *************** *** 43,47 **** TestWaypoint TestSuspend ! TestLGearSteer) foreach(test ${PYTHON_TESTS}) --- 43,48 ---- TestWaypoint TestSuspend ! TestLGearSteer ! TestAeroFuncOutput) foreach(test ${PYTHON_TESTS}) |