diff --git a/test/constants.py b/test/constants.py index c8e4000..afe1020 100755 --- a/test/constants.py +++ b/test/constants.py @@ -1,14 +1,14 @@ #! /usr/bin/env python - ''' Test and stress Constants. ''' +import unittest +import logging from llvm.core import * from llvm.ee import * from ctypes import * -import unittest, logging # logging.basicConfig(level=logging.DEBUG) @@ -135,7 +135,7 @@ class TestConstants(unittest.TestCase): if golden == 0: self.assertEqual(result, golden) else: - self.assertLess(abs(result-golden)/golden, 1e-7) + self.assert_(abs(result-golden)/golden < 1e-7) def test_const_double(self): from random import random @@ -250,7 +250,7 @@ class TestConstants(unittest.TestCase): if golden[1] == 0: self.assertEqual(result[1], golden[1]) else: - self.assertLess(abs(result[1]-golden[1])/golden[1], 1e-7) + self.assert_(abs(result[1]-golden[1])/golden[1] < 1e-7) self.assertEqual(result[2], golden[2]) def test_const_vector(self): diff --git a/test/opaque.py b/test/opaque.py index 329a673..f89334d 100755 --- a/test/opaque.py +++ b/test/opaque.py @@ -6,10 +6,11 @@ from llvm import LLVMException import logging, unittest class TestOpaque(unittest.TestCase): + def test_opaque(self): # Create an opaque type ts = Type.opaque('mystruct') - self.assertIn('type opaque', str(ts)) + self.assertTrue('type opaque' in str(ts)) self.assertTrue(ts.is_opaque) self.assertTrue(ts.is_identified) self.assertFalse(ts.is_literal)