merge with master and fix 4 conflicts by hand
[ardour.git] / libs / ardour / test / framewalk_to_beats_test.cc
index 7e50aedcb54bb0f8b616be3b30c38a920d851123..2385dd53c94bf7316d2dae72dffe07044962468e 100644 (file)
@@ -25,19 +25,19 @@ FramewalkToBeatsTest::singleTempoTest ()
 
        /* Walk 1 beats-worth of frames from beat 3 */
        double r = map.framewalk_to_beats (frames_per_beat * 2, frames_per_beat * 1);
-       CPPUNIT_ASSERT_EQUAL (r, 1.0);
+       CPPUNIT_ASSERT_EQUAL (1.0, r);
 
        /* Walk 6 beats-worth of frames from beat 4 */
        r = map.framewalk_to_beats (frames_per_beat * 3, frames_per_beat * 6);
-       CPPUNIT_ASSERT_EQUAL (r, 6.0);
+       CPPUNIT_ASSERT_EQUAL (6.0, r);
 
        /* Walk 1.5 beats-worth of frames from beat 3 */
        r = map.framewalk_to_beats (frames_per_beat * 2, frames_per_beat * 1.5);
-       CPPUNIT_ASSERT_EQUAL (r, 1.5);
+       CPPUNIT_ASSERT_EQUAL (1.5, r);
 
        /* Walk 1.5 beats-worth of frames from beat 2.5 */
        r = map.framewalk_to_beats (frames_per_beat * 2.5, frames_per_beat * 1.5);
-       CPPUNIT_ASSERT_EQUAL (r, 1.5);
+       CPPUNIT_ASSERT_EQUAL (1.5, r);
 }
 
 void
@@ -59,11 +59,13 @@ FramewalkToBeatsTest::doubleTempoTest ()
 
        /*
          
-         120bpm                                                240bpm
-         0 beats                                               12 beats
-         0 frames                                              288e3 frames
-         |                 |                 |                 |                 |
-         | 1.1 1.2 1.3 1.4 | 2.1 2.2 2.3.2.4 | 3.1 3.2 3.3 3.4 | 4.1 4.2 4.3 4.4 |
+         120bpm                                          240bpm
+         0 beats                                         12 beats
+         0 frames                                        288e3 frames
+         24e3 frames per beat                            12e3 frames per beat
+         |               |               |               |               |
+         1.1 1.2 1.3 1.4 2.1 2.2 2.3 2.4 3.1 3.2 3.3 3.4 4.1 4.2 4.3 4.4 5.1
+         0   1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16
 
        */
 
@@ -74,25 +76,24 @@ FramewalkToBeatsTest::doubleTempoTest ()
 
        /* Now some tests */
 
-       /* Walk 1 beat from 1.2 */
+       /* Walk 1 beat from 1|2 */
        double r = map.framewalk_to_beats (24e3, 24e3);
-       CPPUNIT_ASSERT_EQUAL (r, 1.0);
+       CPPUNIT_ASSERT_EQUAL (1.0, r);
 
-       /* Walk 2 beats from 3.3 to 4.1 (over the tempo change) */
-       r = map.framewalk_to_beats (264e3, (24e3 + 12e3));
-       CPPUNIT_ASSERT_EQUAL (r, 2.0);
+       /* Walk 2 beats from 3|3 to 4|1 (over the tempo change) */
+       r = map.framewalk_to_beats (240e3, (24e3 + 24e3));
+       CPPUNIT_ASSERT_EQUAL (2.0, r);
 
-       /* Walk 2.5 beats from 3.3-and-a-half to 4.2 (over the tempo change) */
+       /* Walk 2.5 beats from 3|3.5 to 4.2 (over the tempo change) */
        r = map.framewalk_to_beats (264e3 - 12e3, (24e3 + 12e3 + 12e3));
-       CPPUNIT_ASSERT_EQUAL (r, 2.5);
-
-       /* Walk 3 beats from 3.4-and-a-half to 4.3-and-a-half (over the tempo change) */
+       CPPUNIT_ASSERT_EQUAL (2.5, r);
+       /* Walk 3 beats from 3|4.5 to 4|3.5 (over the tempo change) */
        r = map.framewalk_to_beats (264e3 - 12e3, (24e3 + 12e3 + 12e3 + 6e3));
-       CPPUNIT_ASSERT_EQUAL (r, 3.0);
+       CPPUNIT_ASSERT_EQUAL (3.0, r);
 
-       /* Walk 3.5 beats from 3.4-and-a-half to 4.4 (over the tempo change) */
+       /* Walk 3.5 beats from 3|4.5 to 4.4 (over the tempo change) */
        r = map.framewalk_to_beats (264e3 - 12e3, (24e3 + 12e3 + 12e3 + 12e3));
-       CPPUNIT_ASSERT_EQUAL (r, 3.5);
+       CPPUNIT_ASSERT_EQUAL (3.5, r);
 }
 
 void