Add a missing return in SBPlatform::IsConnected and test

for the behavior - using the fact that the Host platform
is always present & connected.

llvm-svn: 327448
This commit is contained in:
Jim Ingham 2018-03-13 21:06:05 +00:00
parent 0805b80a73
commit ca38766c9c
2 changed files with 9 additions and 1 deletions

View File

@ -49,6 +49,14 @@ class PlatformPythonTestCase(TestBase):
break
self.assertTrue(platform_found)
@add_test_categories(['pyapi'])
@no_debug_info_test
def test_host_is_connected(self):
# We've already tested that this one IS the host platform.
host_platform = self.dbg.GetPlatformAtIndex(0)
self.assertTrue(host_platform.IsConnected(), "The host platform is always connected")
@add_test_categories(['pyapi'])
@no_debug_info_test
def test_available_platform_list(self):

View File

@ -271,7 +271,7 @@ void SBPlatform::DisconnectRemote() {
bool SBPlatform::IsConnected() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
platform_sp->IsConnected();
return platform_sp->IsConnected();
return false;
}