summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-09-11 00:41:02 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-09-11 00:41:02 +0000
commitb67ef22556815b357e1d06b3556c39c1161b2635 (patch)
treee81287d3245d17aa5ea7dbdd62268e37503aad7a
parent7857d46c640b6e631e1219eeb7b77afd832fce4d (diff)
downloadbcm5719-llvm-b67ef22556815b357e1d06b3556c39c1161b2635.tar.gz
bcm5719-llvm-b67ef22556815b357e1d06b3556c39c1161b2635.zip
[python-bindings] Fixed 3 test failures caused by typos.
llvm-svn: 190465
-rw-r--r--llvm/bindings/python/llvm/core.py5
-rw-r--r--llvm/bindings/python/llvm/tests/test_core.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/llvm/bindings/python/llvm/core.py b/llvm/bindings/python/llvm/core.py
index f7f3748d4c3..19b4bbec256 100644
--- a/llvm/bindings/python/llvm/core.py
+++ b/llvm/bindings/python/llvm/core.py
@@ -125,8 +125,9 @@ class Module(LLVMObject):
def print_module_to_file(self, filename):
out = c_char_p(None)
- result = lib.LLVMPrintModuleToFile(self, filename, byref(out))
- if not result:
+ # Result is inverted so 0 means everything was ok.
+ result = lib.LLVMPrintModuleToFile(self, filename, byref(out))
+ if result:
raise RuntimeError("LLVM Error: %s" % out.value)
class Context(LLVMObject):
diff --git a/llvm/bindings/python/llvm/tests/test_core.py b/llvm/bindings/python/llvm/tests/test_core.py
index e5fffbae59c..07a574e5858 100644
--- a/llvm/bindings/python/llvm/tests/test_core.py
+++ b/llvm/bindings/python/llvm/tests/test_core.py
@@ -37,7 +37,7 @@ class TestCore(TestBase):
def test_create_module_with_name(self):
# Make sure we can not create a module without a LLVMModuleRef.
- with self.assertRaises(RuntimeError):
+ with self.assertRaises(TypeError):
m = Module()
m = Module.CreateWithName("test-module")
@@ -49,7 +49,8 @@ class TestCore(TestBase):
def test_module_getset_target(self):
m = Module.CreateWithName("test-module")
- m.target = "thumbv7-apple-ios5.0.0"
+ target = "thumbv7-apple-ios5.0.0"
+ m.target = target
self.assertEqual(m.target, target)
def test_module_print_module_to_file(self):
OpenPOWER on IntegriCloud