Menu

#402 'valtostr()' cannot handle data sets

v1.1.x
fixed
critical (96)
v1.1.1
Bug Fix
2019-01-27
2018-11-21
Erik Hänel
No

The function valtostr() cannot handle data sets as value input currently.

Analysis:

The issue is that the corresponding string handling function static string parser_ApplySpecialStringFunc() doesn't check for data sets in the evaluation of the valtostr() arguments. To fix this behavior, one has to add a check for "data(" and for _data.containsCacheElements() to the corresponding argument. Add the following lines to the string handling function around line 2025:

(...)
if (!containsStrings(sExpr) && !_data.containsStringVArs(sExpr) (...))
{
    // Add these two lines
    if (sExpr.find("data(") != string::npos || _data.containsCacheElements(sExpr))
        getDataElements(sExpr, _parser, _data, _option);

    int nResults = 0;
    value_type* v = 0;
(...)

Implementation:

  • Implementation: The fix was processed as indicated by the analysis.
  • Revision: [r451]
  • Implementation test: The fix was done by implementing a check for "data" to the corresponding argument.

Documentation:

  • ChangesLog: updated
  • Comments: The changed section were commented
  • Documentation articles: Not needed
  • Language files: Not needed

Tests:

Fix was added to the automatic tests. Deviation was resolved. Bug fix implemented successfully.

1 Attachments

Related

Commit: [r451]
Tickets: #403

Discussion

  • Erik Hänel

    Erik Hänel - 2018-11-21
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-11-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,18 @@
     The function `valtostr()` cannot handle data sets as value input currently. 
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* ChangesLog: (*Have you updated the changes log?*)
    +* Comments: (*Have you written comments in the code, which describe your change?*)
    +* Documentation articles: (*Have you updated the documentation articles?*)
    +* Language files: (*Have you updated the language files?*)
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-11-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,19 @@
     The function `valtostr()` cannot handle data sets as value input currently. 
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The issue is that the corresponding string handling function `static string parser_ApplySpecialStringFunc()` doesn't check for data sets in the evaluation of the `valtostr()` arguments. To fix this behavior, one has to add a check for `"data("` and for `_data.containsCacheElements()` to the corresponding argument. Add the following lines to the string handling function around line 2025:
    +    
    +    :::C++
    +    (...)
    +    if (!containsStrings(sExpr) && !_data.containsStringVArs(sExpr) (...))
    +    {
    +        // Add these two lines
    +        if (sExpr.find("data(") != string::npos || _data.containsCacheElements(sExpr))
    +            getDataElements(sExpr, _parser, _data, _option);
    +        
    +        int nResults = 0;
    +        value_type* v = 0;
    +    (...)
    
     ###Implementation:
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
    • assigned_to: Erik Hänel --> Jonas Jansen
     
  • Erik Hänel

    Erik Hänel - 2018-11-24
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +maexle.nscr (1.5 kB; text/plain)
    
     
  • Erik Hänel

    Erik Hänel - 2018-11-24

    Appended a testing file, which is also valid for ticket [#403].

     

    Related

    Tickets: #403


    Last edit: Erik Hänel 2018-11-24
  • Jonas Jansen

    Jonas Jansen - 2019-01-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -16,15 +16,15 @@
         (...)
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation:  The fix was processed as indicated by the analysis.
    +* Revision: [r451]
    +* Implementation test: The fix was done by implementing a check for "data" to the corresponding argument.
    
     ###Documentation:
    -* ChangesLog: (*Have you updated the changes log?*)
    -* Comments: (*Have you written comments in the code, which describe your change?*)
    -* Documentation articles: (*Have you updated the documentation articles?*)
    -* Language files: (*Have you updated the language files?*)
    +* ChangesLog: updated
    +* Comments: The changed section were commented
    +* Documentation articles: Not needed
    +* Language files: Not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
    • assigned_to: Jonas Jansen --> Erik Hänel
     

    Related

    Commit: [r451]

  • Erik Hänel

    Erik Hänel - 2019-01-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -27,4 +27,4 @@
     * Language files: Not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Fix was added to the automatic tests. Deviation was resolved. Bug fix implemented successfully.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel