[lldb/test] Exted test for CMTime data formatter
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 16 Jan 2020 19:57:57 +0000 (11:57 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 16 Jan 2020 19:58:34 +0000 (11:58 -0800)
Cover more cases handled by the formatter.

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/cmtime/main.m

index 4c3935c851c5e127694340191b46fcd3e9df6c63..8943f8313f3c78088d1c90db36be6efed0f18312 100644 (file)
@@ -30,10 +30,24 @@ class CMTimeDataFormatterTestCase(TestBase):
 
         self.expect(
             'frame variable t1',
+            substrs=[
+                '1 half seconds', 'value = 1', 'timescale = 2', 'epoch = 0'
+            ])
+        self.expect(
+            'frame variable t2',
+            substrs=[
+                '1 third of a second', 'value = 1', 'timescale = 3',
+                'epoch = 0'
+            ])
+        self.expect(
+            'frame variable t3',
             substrs=[
                 '1 10th of a second', 'value = 1', 'timescale = 10',
                 'epoch = 0'
             ])
         self.expect(
-            'frame variable t2',
+            'frame variable t4',
             substrs=['10 seconds', 'value = 10', 'timescale = 1', 'epoch = 0'])
+        self.expect('frame variable t5', '-oo')
+        self.expect('frame variable t6', '+oo')
+        self.expect('frame variable t7', 'indefinite')
index ecf7648c3f980b232f053222161139d82bea770a..f32a347278bc2965a1e48bfe3150b6390f9fffce 100644 (file)
@@ -12,11 +12,24 @@ int main(int argc, const char **argv)
 {
     @autoreleasepool
     {
-        CMTime t1 = CMTimeMake(1, 10);
-        CMTime t2 = CMTimeMake(10, 1);
+        CMTime t1 = CMTimeMake(1, 2);
+        CMTime t2 = CMTimeMake(1, 3);
+        CMTime t3 = CMTimeMake(1, 10);
+        CMTime t4 = CMTimeMake(10, 1);
+        CMTime t5 = CMTimeMake(10, 1);
+        t5.flags = kCMTimeFlags_PositiveInfinity;
+        CMTime t6 = CMTimeMake(10, 1);
+        t6.flags = kCMTimeFlags_NegativeInfinity;
+        CMTime t7 = CMTimeMake(10, 1);
+        t7.flags = kCMTimeFlags_Indefinite;
 
         CMTimeShow(t1); // break here
         CMTimeShow(t2);
+        CMTimeShow(t3);
+        CMTimeShow(t4);
+        CMTimeShow(t5);
+        CMTimeShow(t6);
+        CMTimeShow(t7);
     }
     return 0;
 }