Try to fix the segfault

This commit is contained in:
Raoul Snyman 2014-11-24 23:18:32 +02:00
parent bd79b1d059
commit fbaad51811
10 changed files with 27 additions and 14 deletions

View File

@ -50,8 +50,9 @@ class TestHistoryComboBox(TestCase, TestMixin):
def tearDown(self):
del self.combo
del self.main_window
def getItems_test(self):
def get_items_test(self):
"""
Test the getItems() method
"""

View File

@ -86,12 +86,12 @@ class TestPluginManager(TestCase, TestMixin):
# THEN: We should find the "Songs", "Bibles", etc in the plugins list
plugin_names = [plugin.name for plugin in plugin_manager.plugins]
assert 'songs' in plugin_names, 'There should be a "songs" plugin.'
assert 'bibles' in plugin_names, 'There should be a "bibles" plugin.'
assert 'presentations' in plugin_names, 'There should be a "presentations" plugin.'
assert 'images' in plugin_names, 'There should be a "images" plugin.'
assert 'media' in plugin_names, 'There should be a "media" plugin.'
assert 'custom' in plugin_names, 'There should be a "custom" plugin.'
assert 'songusage' in plugin_names, 'There should be a "songusage" plugin.'
assert 'alerts' in plugin_names, 'There should be a "alerts" plugin.'
assert 'remotes' in plugin_names, 'There should be a "remotes" plugin.'
self.assertIn('songs', plugin_names, 'There should be a "songs" plugin')
self.assertIn('bibles', plugin_names, 'There should be a "bibles" plugin')
self.assertIn('presentations', plugin_names, 'There should be a "presentations" plugin')
self.assertIn('images', plugin_names, 'There should be a "images" plugin')
self.assertIn('media', plugin_names, 'There should be a "media" plugin')
self.assertIn('custom', plugin_names, 'There should be a "custom" plugin')
self.assertIn('songusage', plugin_names, 'There should be a "songusage" plugin')
self.assertIn('alerts', plugin_names, 'There should be a "alerts" plugin')
self.assertIn('remotes', plugin_names, 'There should be a "remotes" plugin')

View File

@ -35,10 +35,14 @@ from PyQt4 import QtCore, QtGui, QtTest
from openlp.core.common import Registry
from openlp.core.lib.searchedit import SearchEdit
from tests.helpers.testmixin import TestMixin
class SearchTypes(object):
"""
Types of search
"""
First = 0
Second = 1
@ -69,6 +73,7 @@ class TestSearchEdit(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.search_edit
del self.main_window
def set_search_types_test(self):

View File

@ -31,14 +31,17 @@ Module-level functions for the functional test suite
"""
import os
from tests.interfaces import patch
from openlp.core.common import is_win
from tests.interfaces import patch
from .test_projectormanager import tmpfile
def setUp():
"""
Set up this module of tests
"""
if not is_win():
# Wine creates a sharing violation during tests. Ignore.
try:

View File

@ -57,6 +57,8 @@ class TestServiceManager(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.service_manager
del self.main_window
def basic_service_manager_test(self):
"""

View File

@ -54,7 +54,7 @@ class TestThemeManager(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.theme_manager
self.destroy_settings()
def initialise_test(self):

View File

@ -73,6 +73,7 @@ class TestBibleManager(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.manager
self.destroy_settings()
def get_books_test(self):

View File

@ -73,6 +73,7 @@ class TestBibleManager(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.manager
self.destroy_settings()
def parse_reference_one_test(self):

View File

@ -34,7 +34,7 @@ from unittest import TestCase
from PyQt4 import QtGui, QtTest, QtCore
from openlp.core.common import Registry
# Import needed due to import problems.
# TODO: FIXME: Import needed due to horrible bad imports
from openlp.plugins.custom.lib.mediaitem import CustomMediaItem
from openlp.plugins.custom.forms.editcustomform import EditCustomForm
from tests.interfaces import MagicMock, patch

View File

@ -76,8 +76,8 @@ class TestMediaClipSelectorForm(TestCase, TestMixin):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
self.vlc_patcher.stop()
del self.form
self.vlc_patcher.stop()
del self.main_window
def basic_test(self):