[Bug291070] Fix for multi-traces support at the framework level + unit tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.tests / stubs / org / eclipse / linuxtools / tmf / CreateTestFiles.java
index db6ea3a09b4246e90dc1038f6e535c9ad207d862..d2d66abccb7e503a6d8a9e84ea419c60e6d9f1a6 100644 (file)
@@ -39,8 +39,10 @@ public class CreateTestFiles {
     // ========================================================================
 
        private static final String DIRECTORY = "testfiles";
-       private static final String FILE_NAMES[] = { "Test-10", "Test-1K", "Test-10K", "Test-100K" };
-    private static final int    FILE_SIZES[] = {       10 ,     1000 ,     10000 ,     100000  };
+//     private static final String FILE_NAMES[] = { "Test-10", "Test-1K", "Test-10K", "Test-100K" };
+//    private static final int    FILE_SIZES[] = {       10 ,     1000 ,     10000 ,     100000  };
+       private static final String FILE_NAMES[] = { "Test-10K" };
+    private static final int    FILE_SIZES[] = {     10000  };
 
     private static final int NB_SOURCES = 15;  
     private static final int NB_TYPES   =  7;  
@@ -62,8 +64,9 @@ public class CreateTestFiles {
 
         for (int i = 0; i < FILE_SIZES.length; i++) {
             try {
-               createTestFile("testfiles" + File.separator + "M-" + FILE_NAMES[i], FILE_SIZES[i], true);
-                createTestFile("testfiles" + File.separator + "R-" + FILE_NAMES[i], FILE_SIZES[i], false);
+               createTestFile("testfiles" + File.separator + "O-" + FILE_NAMES[i], FILE_SIZES[i], true,  true);
+               createTestFile("testfiles" + File.separator + "E-" + FILE_NAMES[i], FILE_SIZES[i], true,  false);
+                createTestFile("testfiles" + File.separator + "R-" + FILE_NAMES[i], FILE_SIZES[i], false, false);
             } catch (Exception e) {
             }
         }
@@ -82,15 +85,15 @@ public class CreateTestFiles {
      * @throws FileNotFoundException
      * @throws IOException
      */
-    private static void createTestFile(String file, int size, boolean monotonic) throws FileNotFoundException, IOException {
+    private static void createTestFile(String file, int size, boolean monotonic, boolean odd) throws FileNotFoundException, IOException {
         DataOutputStream out;
         System.out.println("Creating " + file);
         out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
 
         Random generator = new Random(19580427 + size);
-        long ts = 0;
+        long ts = (monotonic && odd) ? -1 : 0;
         for (int i = 0; i < size; i++) {
-            ts += monotonic ? 1 : generator.nextInt(10);
+            ts += monotonic ? 2 : generator.nextInt(10);
             int sourceIndex = i % NB_SOURCES;
             int typeIndex   = i % NB_TYPES;
             out.writeLong(ts);                      // Timestamp
This page took 0.02468 seconds and 5 git commands to generate.