Added more tests + code cleanup#35
Conversation
readline() from seg. faulting.
…ode.
It is not compiled into the libraries.
clgetSVal.cc: Not required any more
clgetFullVal.cc: Includes clgetValp.h
ParseCmdLine.cc: Changes to use clgetValp() calls.
code/CMakeLists.txt: Stop complining clget{S,NS}Val.o
Install clgetValp.cc also.
test_parafeed_interactive.cpp: Added test for clgetFullVal().
test_parafeed_noninteractive.cpp: Added an interactive test that was
earlier failing ('cause not all
library state variables were reset).
Testing if adding on: workflow_dispatch enables triggering runners by-hand (e.g. for testing branches other than `master` and `main`.
Removed trailing whitespaces, coverted code formatting to be
consistent with the rest of the code (which is GNU-style).
Removed calls to clCleanUp() in the test code (it is called
in ~ParafeedTest()).
{ParseCmdLine,callbacks,support}.cc: Replaced exit() with throw(clExit()).
tstcpp.cc: Also catch clExit().
and help=def[,File] modes.
_noninteractive.cpp: Changes in names of global functions _interactive.cpp: Added a test for complimentary load testing.txt: Marked tests that are now implemented as DONE.
Test for dbg-class keys visibilit. Test for hidden keys. _noninteractive.cpp: General cleanup + tests for dbg-class keys.
memory allocation/freeing.
ParafeedTest.h: Removed the writeDefFile parameters from all functions
and where they are called.
test_parafeed_*: Changes due to change in ParafeedTest API.
Fixed DefModeWithDefFileError test.
Added more information in the [Info] string.
| int clgetNSValp(const std::string& Name, std::vector<std::string>& val, int& n) {return clgetValp(Name,val,n);} | ||
| int clgetNSValp(const std::string& Name, std::vector<std::string>& val, int& n, SMap &smap) {return clgetValp(Name,val,n,smap);} | ||
| int clgetNSValp(const std::string& Name, std::vector<std::string>& val, int& n, const SMap smap) {return clgetValp(Name,val,n,smap);} | ||
| inline int clgetSVal(const char *Name, char *val, int *n) {return clgetValp(std::string(Name), *val, *n);} |
There was a problem hiding this comment.
I see this is a newly added function, but it seems to call the the template function clgetValp wrong. The *val in clgetValp(std::string(Name), *val, *n); is a single character, not a buffer that is writable, so when users write
char buf[10]; clgetSVal(..., buf, &n);
and expect a full string written into buf, only buf[0] is modified.
It should call clgetValp(std::string(Name), val, *n);, instead.
There was a problem hiding this comment.
It turns out that making the clgetSVal() interface and all its variables work require more work in a number of files. So I have currently disabled this interface (i.e. using it will lead to compile-time error). The solution, for now, is to use the clgetSValp() interface that show for std::string value.
Code that would test the clgetSVal() interface in ParafeedTest.h is left as a comment, which we will enable as part of a separate PR to get clgetSVal() and variants work.
and will be included in a separate PR.
clgetValp.cc: Disabled forward decl of type
clgetSVal(const char *Name, char *val, int *n).
clgerFullVal.cc: Translated clgetSVal() to clgetSValp() (the C++
interface).
ParafeedTest.h: Left commented code to test the clgetSVal() interface,
which currently leads to compile-time error.
|
I reviewed all of the code changes in this pull request. It looks good now and can be merged. |
shell.lthat prevents seg. fault inreadline()if the env. variableTERMis not defined.clExit()exception to use instead of callingexit().workflow_dispatch:inparafeed_CI.yamlto allow manual trigger for CI runner.tstcppby-hand.