Use correct of get c string of std::string; add more unit tests