# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

"""Test routines."""

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError('Python 2.7 or later required')

# Import the low-level C/C++ module
if __package__ or '.' in __name__:
    from . import _testing
else:
    import _testing

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if name == "thisown":
        return self.this.own(value)
    if name == "this":
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if not static:
        object.__setattr__(self, name, value)
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if name == "thisown":
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _testing.delete_SwigPyIterator

    def value(self):
        return _testing.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _testing.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _testing.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _testing.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _testing.SwigPyIterator_equal(self, x)

    def copy(self):
        return _testing.SwigPyIterator_copy(self)

    def next(self):
        return _testing.SwigPyIterator_next(self)

    def __next__(self):
        return _testing.SwigPyIterator___next__(self)

    def previous(self):
        return _testing.SwigPyIterator_previous(self)

    def advance(self, n):
        return _testing.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _testing.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _testing.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _testing.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _testing.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _testing.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _testing.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _testing:
_testing.SwigPyIterator_swigregister(SwigPyIterator)


class TestFailed:
    """TestFailed is used to raise an uniform exception in tests."""

    __type = "TestFailed"

    def __init__(self, reason=""):
        self.reason = reason

    def type(self):
        return TestFailed.__type

    def what(self):
        return self.reason

    def __str__(self):
        return TestFailed.__type + ": " + self.reason

    def __lshift__(self, ch):
        self.reason += ch
        return self

import openturns.typ
import openturns.common
import openturns.statistics
import openturns.graph
import openturns.func
import openturns.geom
class ExitCode(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    Success = _testing.ExitCode_Success
    Error = _testing.ExitCode_Error
    ExpectedToFail = _testing.ExitCode_ExpectedToFail

    def __init__(self):
        _testing.ExitCode_swiginit(self, _testing.new_ExitCode())
    __swig_destroy__ = _testing.delete_ExitCode

# Register ExitCode in _testing:
_testing.ExitCode_swigregister(ExitCode)


def parseOptions(argc, argv):
    return _testing.parseOptions(argc, argv)

def setRandomGenerator():
    return _testing.setRandomGenerator()
class TestFailed(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self, message):
        _testing.TestFailed_swiginit(self, _testing.new_TestFailed(message))
    __swig_destroy__ = _testing.delete_TestFailed

    def what(self):
        return _testing.TestFailed_what(self)

# Register TestFailed in _testing:
_testing.TestFailed_swigregister(TestFailed)


def __lshift__(os, obj):
    return _testing.__lshift__(os, obj)

def assert_almost_equal(*args):
    return _testing.assert_almost_equal(*args)


