Commit 5f8e4121 authored by Jonas Devlieghere's avatar Jonas Devlieghere
Browse files

[lldb/test] Exted test for CMTime data formatter

Cover more cases handled by the formatter.
parent f5d98543
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -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')
+15 −2
Original line number Diff line number Diff line
@@ -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;
}