brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 60906c1 Raw
56 lines · python
1"""2Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued3"""4 5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class Rdar10967107TestCase(TestBase):13    def setUp(self):14        # Call super's setUp().15        TestBase.setUp(self)16        # We'll use the test method name as the exe_name.17        self.exe_name = self.testMethodName18        # Find the line number to break inside main().19        self.main_source = "main.m"20        self.line = line_number(self.main_source, "// Set breakpoint here.")21 22    def test_cfrange_diff_cfgregoriandate(self):23        """Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued."""24        d = {"EXE": self.exe_name}25        self.build(dictionary=d)26        self.setTearDownCleanup(dictionary=d)27 28        exe = self.getBuildArtifact(self.exe_name)29        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)30 31        lldbutil.run_break_set_by_file_and_line(32            self, self.main_source, self.line, num_expected_locations=1, loc_exact=True33        )34 35        self.runCmd("run", RUN_SUCCEEDED)36        # check that each type is correctly bound to its list of children37        self.expect(38            "frame variable cf_greg_date --raw",39            substrs=["year", "month", "day", "hour", "minute", "second"],40        )41        self.expect("frame variable cf_range --raw", substrs=["location", "length"])42        # check that printing both does not somehow confuse LLDB43        self.expect(44            "frame variable  --raw",45            substrs=[46                "year",47                "month",48                "day",49                "hour",50                "minute",51                "second",52                "location",53                "length",54            ],55        )56