Exemple #1
0
def test_defined_constant_float():
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.0')
    assert value == 1.0
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.5')
    assert value == 1.5
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.0e20')
    assert value == 1.0e20
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.0e50000')
    assert value == float("inf")
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH (double)0/0')
    assert isnan(value)
def test_defined_constant_float():
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.0')
    assert value == 1.0
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.5')
    assert value == 1.5
    value = rffi_platform.getdefineddouble('BLAH', '#define BLAH 1.0e20')
    assert value == 1.0e20
    if platform.name != 'msvc':
        value = rffi_platform.getdefineddouble('BLAH',
                                               '#define BLAH 1.0e50000')
        assert value == float("inf")
        value = rffi_platform.getdefineddouble('BLAH',
                                               '#define BLAH (double)0/0')
        assert isnan(value)
Exemple #3
0
def test_defined_constant():
    res = rffi_platform.getdefineddouble('ABCDFGH', '#define ABCDFGH 2.0')
    assert res == 2.0
    res = rffi_platform.getdefinedinteger('ABCDFGH', '#define ABCDFGH 2')
    assert res == 2
def test_defined_constant():
    res = rffi_platform.getdefineddouble('ABCDFGH', '#define ABCDFGH 2.0')
    assert res == 2.0
    res = rffi_platform.getdefinedinteger('ABCDFGH', '#define ABCDFGH 2')
    assert res == 2