Migrated set-insdel-string stress test to gtest
[libcds.git] / test / stress / framework / stress_test.cpp
index 498f3146ad3571a538f457cc2e41e7f2ce87895e..b9e4d7d4d18afb8df32ce6365c0ac64e7ddced1a 100644 (file)
@@ -28,6 +28,8 @@
     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
@@ -40,4 +42,33 @@ namespace cds_test {
         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