#!/usr/bin/env python
#
# New SWIG releases produce
# non-coercing code. This checks for booleans
#
import coral
import re

try:
    L1 = coral.Language.__getLanguage__("UML", 1, 4, False)
except RuntimeError,e:
    print "Got exception", e
    print "Checking if it was expected..."
    assert re.search("coral::language_not_found_error:", str(e))
    print "OK!"
    print

b = coral.Boolean.newAtom()
b.__setEValueByName__("false")
try:
    L1 = coral.Language.__getLanguage__("UML", 1, 4, b)
except RuntimeError,e:
    print "Got exception", e
    print "Checking if it was expected..."
    assert re.search("coral::language_not_found_error:", str(e))
    print "OK!"
    print

b.__setEValueByName__("true")
try:
    L1 = coral.Language.__getLanguage__("UML", 1, 4, b)
except:
    assert 0

assert L1 is not None
assert L1 != None
