File: test_null_comparison.py

package info (click to toggle)
pygccxml 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,444 kB
  • sloc: xml: 29,841; python: 13,914; cpp: 2,671; makefile: 163; ansic: 59
file content (31 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt

from . import autoconfig

from pygccxml import parser
from pygccxml import declarations

TEST_FILES = [
    "null_comparison.hpp",
]


def test_argument_null_comparison():
    """
    Test for None comparisons with default arguments
    """

    config = autoconfig.cxx_parsers_cfg.config.clone()
    decls = parser.parse(TEST_FILES, config)
    global_ns = declarations.get_global_namespace(decls)

    ns = global_ns.namespace("ns")

    func = ns.free_function(name="TestFunction1")
    assert (func.arguments[0] > func.arguments[1]) is False

    func = ns.free_function(name="TestFunction2")
    assert (func.arguments[0] > func.arguments[1]) is False