[ 
https://issues.apache.org/jira/browse/GEODE-2470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15865019#comment-15865019
 ] 

ASF GitHub Bot commented on GEODE-2470:
---------------------------------------

Github user pivotal-jbarrett commented on a diff in the pull request:

    https://github.com/apache/geode-native/pull/6#discussion_r100956809
  
    --- Diff: src/cppcache/integration-test/CacheHelper.cpp ---
    @@ -1382,6 +1377,31 @@ void 
CacheHelper::createDuplicateXMLFile(std::string& originalFile,
              CacheHelper::staticConfigFileList.size());
     }
     
    +void CacheHelper::replacePortsInFile(int hostPort1, int hostPort2,
    +                                     int hostPort3, int hostPort4, int 
locPort1,
    +                                     int locPort2, const std::string& 
inFile,
    +                                     const std::string& outFile) {
    +  std::ifstream in(inFile, std::ios::in | std::ios::binary);
    +  if (in) {
    +    std::string contents;
    +    in.seekg(0, std::ios::end);
    +    contents.resize(in.tellg());
    --- End diff --
    
    I think you want `reserve()`. `resize()` causes the string to be resized 
and initialized with `CharT()`. `reserve()` just allocates enough capacity but 
does not resize or initialize the string.
    



> Remove Dependency on sed tool
> -----------------------------
>
>                 Key: GEODE-2470
>                 URL: https://issues.apache.org/jira/browse/GEODE-2470
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Michael Martell
>
> The integration tests currently rely on sed to replace strings inside config 
> xml files. This task replaces that dependency with standard C++ code.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to