more Python 2.6 test fixes
This commit is contained in:
parent
7f3550f93d
commit
f54e195121
2 changed files with 6 additions and 5 deletions
|
|
@ -1,14 +1,14 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Test and stress Constants.
|
Test and stress Constants.
|
||||||
'''
|
'''
|
||||||
|
import unittest
|
||||||
|
import logging
|
||||||
|
|
||||||
from llvm.core import *
|
from llvm.core import *
|
||||||
from llvm.ee import *
|
from llvm.ee import *
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
|
|
||||||
import unittest, logging
|
|
||||||
|
|
||||||
# logging.basicConfig(level=logging.DEBUG)
|
# logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ class TestConstants(unittest.TestCase):
|
||||||
if golden == 0:
|
if golden == 0:
|
||||||
self.assertEqual(result, golden)
|
self.assertEqual(result, golden)
|
||||||
else:
|
else:
|
||||||
self.assertLess(abs(result-golden)/golden, 1e-7)
|
self.assert_(abs(result-golden)/golden < 1e-7)
|
||||||
|
|
||||||
def test_const_double(self):
|
def test_const_double(self):
|
||||||
from random import random
|
from random import random
|
||||||
|
|
@ -250,7 +250,7 @@ class TestConstants(unittest.TestCase):
|
||||||
if golden[1] == 0:
|
if golden[1] == 0:
|
||||||
self.assertEqual(result[1], golden[1])
|
self.assertEqual(result[1], golden[1])
|
||||||
else:
|
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])
|
self.assertEqual(result[2], golden[2])
|
||||||
|
|
||||||
def test_const_vector(self):
|
def test_const_vector(self):
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,11 @@ from llvm import LLVMException
|
||||||
import logging, unittest
|
import logging, unittest
|
||||||
|
|
||||||
class TestOpaque(unittest.TestCase):
|
class TestOpaque(unittest.TestCase):
|
||||||
|
|
||||||
def test_opaque(self):
|
def test_opaque(self):
|
||||||
# Create an opaque type
|
# Create an opaque type
|
||||||
ts = Type.opaque('mystruct')
|
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_opaque)
|
||||||
self.assertTrue(ts.is_identified)
|
self.assertTrue(ts.is_identified)
|
||||||
self.assertFalse(ts.is_literal)
|
self.assertFalse(ts.is_literal)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue