Template refactoring + more unittests#33
Conversation
reporting matching failure. This is in prep to support user-supplied functionls for more sophistacted matching and reporting.
Also setting the S->Attributes and ->CLASS bits.
and fixed the code to set the Symbol::Attributes and ::Class bits.
for T=int,float,bool,std::string
clgetValp.cc: With the clparseVal properly templated, separate
implementations for T=string or T=std::vector<string>
for cl[dbg]getValp aren't necessary. This reduces
the number of template functions by four.
CMakeLists.txt: Removed duplication clparseVal.h
tstcpp.cc, clgetValp.h, clgetBaseCode.h: Date change in Copyright notice.
This reverts commit 94c0d6e.
…work!
(see commented code)
SetVar.cc: Re-set S->Val in case of error during parsing/setting values.
Some cleanup + adding more unit tests.
a function for scanning input stream for parsing.
clgetBaseCode.h: Throw exception if the searched symbol is not found.
test_parafeed_noninteractive.cpp: Not-yet-working attempts at
setting shell_input function.
Nominal support for setting the input source for flex scanner
(see the note below)
test_parafeed_{non}interactive.cpp: Added the interactive test.
Switching the input source of flex scanner does not work within a
single file. All test in a single file are run in the same process in
GTest. And I (SB) haven't yet figure out how to set the YY_INPUT
macro to different input sources dynamically at runtime. Therefore,
current the interactive and non-interactive tests are in separate
file.
session get tested. Add explanatory comments.
|
All I am not sure why. |
…Correctly test
to be non-interactive.
As Sanjay mentioned he took short cuts in the The fix is to implement The suggested fix is as followed. --- a/code/test/unittest/ParafeedTest.h string cmd_g; //------------------------------------------------------------------
//------------------------------------------------------------------ |
the clgetNValBaseCode() call. See change request in PR #33. test_parafeed_interactive.cpp: Typo corrections in the comments.
(see comments for PR #33) Added std:: name space for string and vector<T> Reorganized the wrapper for clgetValp() to reduce cognitive overload for humans clgetValp.cc: Reorganized the wrapper for clgetValp() to reduce cognitive overload for humans
Can you send the output of |
See attached. |
test_parafeed_interactive.cpp: Removed a stray comment not applicable now.
|
The patch for The patched however seems like a good improvement, and the |
After investigating this further, the issue is in the Attached are the patches to fix this issue as well as a new unit test that unsets |
This is impressive debugging! Now that you found it out, it also makes good sense. Since you found it, do you want to apply the patch and push on this branch? That would be appropriate too. |
…en TERM is unset
(i.e. getenv("TERM") == NULL), avoiding std::string construction from a null pointer.
Added a new unit test that unsets TERM and verifies clTextColouring(...) does not throw,
then restores the environment variable afterward.
agawatw
left a comment
There was a problem hiding this comment.
All issues have been fixed.
The major change in this commit is refactoring of the code in
clgetBaseCode.handclgetValp()that reduces the number of templated functions to be maintained to only two.Also added a few missing API call for
dbgcl*()functions (also inclgetValp.cc)Cleanup
in the error handling framework. Added capability to set theYY_INPUT` scanner from API. However, it is not yet possible to set this multiple time dynamically at runtime.And added some more unittests, most importantly to start testing the interactive modes as well.