OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <fstream>
+#include <iostream>
#include <cds_test/stress_test.h>
\r
namespace cds_test {\r
static property_stream s_prop_stream;\r
return s_prop_stream;\r
}\r
+\r
+ /*static*/ std::vector<std::string> stress_fixture::load_dictionary()\r
+ {\r
+ std::vector<std::string> arrString;\r
+\r
+ std::ifstream s;
+ char const* filename = "./dictionary.txt";
+ s.open( filename );
+ if ( !s.is_open() ) {
+ std::cerr << "WARNING: Cannot open test file " << filename << std::endl;
+ return arrString;
+ }
+\r
+ std::string line;\r
+ std::getline( s, line );\r
+\r
+ arrString.reserve( std::stoul( line ));\r
+\r
+ while ( !s.eof() ) {\r
+ std::getline( s, line );\r
+ if ( !line.empty() )\r
+ arrString.push_back( std::move( line ));\r
+ }\r
+\r
+ s.close();\r
+\r
+ return arrString;\r
+ }\r
+\r
} // namespace\r