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