2 Read in a library with a version number of 0.0.0, make sure we produce a good version.
8 from lldbsuite
.test
import decorators
9 import lldbsuite
.test
.lldbutil
as lldbutil
10 from lldbsuite
.test
.lldbtest
import *
13 class TestGetVersionForZero(TestBase
):
15 mydir
= TestBase
.compute_mydir(__file__
)
17 # If your test case doesn't stress debug info, the
18 # set this to true. That way it won't be run once for
19 # each debug info format.
20 NO_DEBUG_INFO_TESTCASE
= True
22 def test_get_version_zero(self
):
23 """Read in a library with a version of 0.0.0. Test SBModule::GetVersion"""
24 self
.yaml2obj("libDylib.dylib.yaml", self
.getBuildArtifact("libDylib.dylib"))
28 lib_name
= "libDylib.dylib"
29 target
= lldbutil
.run_to_breakpoint_make_target(self
, exe_name
=lib_name
)
30 module
= target
.FindModule(lldb
.SBFileSpec(lib_name
))
31 self
.assertTrue(module
.IsValid(), "Didn't find the libDylib.dylib module")
32 # For now the actual version numbers are wrong for a library of 0.0.0
33 # but the previous code would crash iterating over the resultant
34 # list. So we are testing that that doesn't happen.
36 for elem
in module
.GetVersion():
38 self
.assertTrue(did_iterate
, "Didn't get into the GetVersion loop")