import os
import sys
import math
import random

path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
sys.path.insert(0, path)

from msl.loadlib import (
    IS_PYTHON_64BIT,
    LoadLibrary,
)

bitness = 'x64' if IS_PYTHON_64BIT else 'x86'
filename = 'legacy_v2_runtime_{}.dll'.format(bitness)
path = os.path.abspath(os.path.join(os.path.dirname(__file__), filename))

# this is not necessary, just wanted to randomly select
# one of the supported .NET libtype's
libtype = 'clr' if random.random() > 0.5 else 'net'

net = LoadLibrary(path, libtype)

if net.lib.SpelNetLib.SpelAxis.X != 1:
    sys.exit('net.lib.SpelNetLib.SpelAxis.X != 1')

atan = net.lib.SpelNetLib.Spel().Atan(1e9)
if abs(math.pi / 2.0 - atan) > 1e-6:
    sys.exit('Atan: {} != Pi/2'.format(atan))

print('SUCCESS')

@@ -18,20 +18,8 @@
 sys%0A
-import math%0A
 impo
@@ -621,170 +621,24 @@
 it('
-net.lib.SpelNetLib.SpelAxis.X != 1')%0A%0Aatan = net.lib.SpelNetLib.Spel().Atan(1e9)%0Aif abs(math.pi / 2.0 - atan) %3E 1e-6:%0A    sys.exit('Atan: %7B%7D != Pi/2'.format(atan)
+SpelAxis.X != 1'
 )%0A%0Ap

remove the Spel().Atan() call since this raises DLL dependency issues