Commit Graph

137 Commits

Author SHA1 Message Date
jmpenn
cc6fbc4ff2
Fix and unittest lqueue functions in trick_adt. (#1598) 2023-10-26 10:26:40 -05:00
jmpenn
1d0e324c6f
Fix a variety of bugs found in dllist.c while addressing Issue #1559. (#1577)
* Fix a variety of bugs found in dllist.c while addressing Issue #1559.

* Added More descriptive error messages.
* Wrote google-test based unit tests for the DLL List library.
* Deleted old, incomplete test program.
* Added new function DLL_ListContainsPos which determines whether the given list contains the node at the given pos.
* DLLFind bug: Added check to determine whether a compare function has been specified, and emit an error message if it hasn’t.
* DLL_FindIndex bug: Corrected bounds checking.
* DLL_GetAt bug: Added check to ensure that the specified pos is actually in the given list.
* DLL_SetAt bug: Added check to ensure that the specified pos is actually in the given list.
* DLL_RemoveAt: corrected logic mistake in NULL ptr check. Added check to ensure that the specified pos is actually in the given list.
* DLL_InsertBefore bug: element count not correctly updated.
* DLL_InsertAfter: next and prev ptrs not correctly updated, which corrupted the list.
* DLL_GetNext bug: logic error in NULL ptr checks. Added check to ensure that the specified pos is actually in the given list.
* DLL_GetPrev bug: logic error in NULL ptr checks. Added check to ensure that the specified pos is actually in the given list.
* DLL_AddHead: Fixed NULL check logic error.
* DLL_AddTail: Fixed NULL check logic error.

* Address review comments, remove extraneous make target.

* Change false to 0 in dllist.c
2023-10-05 13:33:38 -05:00
Deans
99ee88a686 Add more Variable Server unit and integration tests, clean up and clarify naming 2023-06-26 12:23:58 -05:00
Jacqueline Deans
0788dcfa9b Replace TrickComm with new connection_handler library 2023-06-26 12:23:58 -05:00
Jacqueline Deans
c2e42f4ef4 Refactor and test Variable Server.
- Split VariableServerThread into VariableServerSession and VariableReference classes
- Use C++ streams for data handling
- Unit tests
2023-06-26 12:23:58 -05:00
Alex Lin
ad42376d5e
Variable Server byteswapping crashes the sim #1513 (#1514)
* Variable Server byteswapping crashes the sim #1513

The code to byteswap a variable server buffer has a comment saying there is a bug. The comment is
correct.  The original code would swap the parameter and anything else that followed that parameter
in the structure.  Crashes everywhere.  Created a new routine that byteswaps a single parameter.
Strangely we didn't have such a routine until now.  Did some testing of doubles, floats, ints,
shorts, and chars and all were swapped correctly.

* Variable Server byteswapping crashes the sim #1513

enabling binary byteswap test.
2023-06-01 13:20:14 -05:00
jmpenn
9b3e6aac51
Update README.md
Fix title of Trick::flt_is_near
2023-03-03 13:30:52 -06:00
Jacqueline Deans
5f6a5de070
Expand SIM_test_varserver (#1459)
* Add tests for alternate ways to open VS port

* Don't connect to varserv when quiet=true in trickops

* Add print to try to help debug hanging trickops test

* Handle multicast connect failures gracefully

* Multicast is disabled by default on mac

* Forgot an important return value

* Take away retries

* Fix issue with restart test

* Revert trickops debugging changes

* Remove debugging accidentally left in [no ci]

* whoops

* Allow retries

* Update trickops.py

* sim test adjustments

* Add docs [no ci]

* wording [no ci]

* Cleanup

* Remove large messages, test that one in unit tests
2023-02-24 14:44:55 -06:00
Jacqueline Deans
9c7becb4ff
Handle thread shutdown gracefully and test (#1448)
---------

Co-authored-by: Dan Jordan <daniel.d.jordan@nasa.gov>
2023-02-08 17:58:59 -06:00
Jacqueline Deans
8be3e30f7a
Fix Mac pipeline (#1454) 2023-02-07 15:35:22 -06:00
jmpenn
afbc78c5e7
Initial commit of compareFloatingPoint utils. (#1443)
* Initial commit of compareFloatingPoint utils.

* Update .gitignore to properly ignore unittest executables.
2023-02-01 15:54:31 -06:00
Jacqueline Deans
807161b19c
Fix 32 bit pipeline (#1430) 2023-01-16 15:54:23 -06:00
Jacqueline Deans
97cf685b6a
Parser and test for var_binary (#1425) 2023-01-11 09:27:30 -06:00
jmpenn
2a03ff5cf4
Replace sprintf with snprintf in all of Trick source. #1384 (#1392)
* Replace sprintf with snprintf in all of Trick source. #1384

* Don't add -Werror for MacOS because of deprecated sprintf warnings which we cant get rid of because SWIG. #1384

* Fixed an unbalanced parenthesis in S_overrides.mk. #1384
2022-11-15 15:00:05 -06:00
Jacqueline Deans
900f7b18be
Generate test coverage and use Coveralls for tracking and visualization (#1366)
* Add code-coverage make target and github actions workflow
* Upload coverage to coveralls
* Add coverage badge to readme
* Fix some test makefiles to correctly propagate flags
2022-10-13 14:23:16 -05:00
Scott Fennell
c390ca5ba6
replace GTEST_HAS_TR1_TUPLE with -std=c++11 (#1331) 2022-08-11 15:10:29 -05:00
Alex Lin
496de8c7a9
Disambiguate python use #1250 (#1251)
* Disambiguate python use #1250

Changed all calls to /usr/bin/python to /usr/bin/env python3.  Removed execute permissions on a lot of files that are not executable.

closes #1250
2022-03-22 15:15:40 -05:00
John M. Penn
792e0bc48f Fix typos in interpolator README. #1240 [skip ci] 2022-03-15 14:27:07 -05:00
John M. Penn
e9f58c32f8 Document exeption from Trick::Interpolator.eval() #1240 2022-03-15 12:01:20 -05:00
John M. Penn
f3c00ee5c0 Add documentation for the Trick::Interpolator class with examples. #1240
[skip ci]
2022-03-15 11:09:06 -05:00
Penn, John M 047828115
e487e5609f Initial excision of DMTCP from Trick. #28 2021-08-27 19:38:56 -05:00
Scott Fennell
a88f38b55c
Fix unit test name (RankineToCelsius)
Co-authored-by: Tobias Nießen <tniessen@users.noreply.github.com>
2021-06-01 13:26:21 -05:00
jmpenn
334f8859da
Update Tutorial.md 2021-03-30 10:39:30 -05:00
Penn, John M 047828115
cfc7210f52 Update SAIntegrator tutorial for RKF45. #1123 2021-03-30 09:59:20 -05:00
Penn, John M 047828115
a5e67ae3a9 SAIntegrator: Add RKF45Integrator_unittest. #1114 2021-03-02 13:23:26 -06:00
Penn, John M 047828115
c82ff9a72b SAIntegrator: Add gitignore file for unittest directory. 2021-02-25 23:00:11 -06:00
Penn, John M 047828115
b1c22f2b14 SAIntegrator: Add gitignore files. 2021-02-25 22:58:39 -06:00
Penn, John M 047828115
b67612e506 SAIntegrator: update examples makefile to add AsteroidFlyBy. #1114 2021-02-25 12:00:15 -06:00
Penn, John M 047828115
a2a3ff1dcc SAIntegrtor: Add example sim for RKF45 called AsteroidFlyBy. #1114 2021-02-24 22:40:56 -06:00
Penn, John M 047828115
e696254bc5 SAIntegrator: Add getLastStepSize() method to RKF45Integrator. #1114 2021-02-24 22:38:35 -06:00
Penn, John M 047828115
320ff5915a adaptive_step shoould return next_h, not default_h. #1114 2021-02-22 17:23:50 -06:00
Penn, John M 047828115
8e3f99e4fe SAIntegrator: Add Runge-Kutta-Fehlberg 4(5), an adaptive step-size integrator. #1114 2021-02-22 17:17:29 -06:00
Penn, John M 047828115
ae9ecf2196 Make intermediate work variables local to step functions, and simplify constructors, destructors, copy-constructors, and assignment opertors. #1113 2021-02-22 16:48:13 -06:00
Penn, John M 047828115
7f045f0d72 Fix missing link in the SAIntegrator Tutorial. #1097 2021-01-27 13:18:52 -06:00
Penn, John M 047828115
7d9c0e00ff Tag code blocks as being C++ for proper code coloring. #1097 2021-01-27 13:06:28 -06:00
Penn, John M 047828115
0facb73c7d Add SAIntegrator Tutorial. #1097 2021-01-27 12:49:45 -06:00
Penn, John M 047828115
b929c62d77 Update SAIntegrator README.md. #1097 2021-01-27 12:48:32 -06:00
Penn, John M 047828115
b190ade246 Update makefile to build new SAIntegrator examples. #1097 2021-01-27 12:47:08 -06:00
Penn, John M 047828115
8e8f761afb Use -std=c++11 to compile SAIntegrator. #1097 2021-01-27 12:45:08 -06:00
Penn, John M 047828115
7ce4514f74 Add include guards to Rootfinder.hh. #1097 2021-01-27 12:42:02 -06:00
Penn, John M 047828115
8a015b3621 Update MassSpringDamper example for the Tutorial. #1097 2021-01-27 12:39:52 -06:00
Penn, John M 047828115
e317b8e7f6 Update DoubleIntegral example for the Tutorial. #1097 2021-01-27 12:36:07 -06:00
Penn, John M 047828115
f87c432bd4 Add DefiniteIntegral example for Tutorial. #1097 2021-01-27 12:30:36 -06:00
Penn, John M 047828115
b5a33b1b44 Add BouncyCannonBall example to demonstrate dynamic events. #1097 2021-01-27 12:27:01 -06:00
Penn, John M 047828115
2be2aac0e3 Update the CannonBall example for the Tutorial. #1097 2021-01-27 12:22:16 -06:00
Penn, John M 047828115
99f42bb6c4 Add new integrator constructors in SAIntegrator #1096 2021-01-27 12:09:33 -06:00
Penn, John M 047828115
69b8d2f0ad Spiff up SAInteger Cannonball sim example, like the other examples. 2021-01-06 17:17:49 -06:00
Penn, John M 047828115
0c4907f78c Improvements to README similar to those of Orbit sim. 2021-01-06 16:53:00 -06:00
Penn, John M 047828115
ef127f8a36 Improve the organization and description of the Orbit example sim for SAIntegrator, in prep for tutorial. 2021-01-06 16:50:24 -06:00
Penn, John M 047828115
519f23685b Add periodic impulse to MassSpringDamper sim. Improve README. Fix plot script. 2021-01-05 16:00:52 -06:00