Commit 5edc00e7 authored by Robert Bradshaw's avatar Robert Bradshaw

C++ namespace tests.

parent 7b39a311
cdef extern from "cpp_namespaces_helper.h" namespace "A":
ctypedef int A_t
A_t A_func(A_t first, A_t)
cdef extern from "cpp_namespaces_helper.h" namespace "outer":
int outer_value
cdef extern from "cpp_namespaces_helper.h" namespace "outer::inner":
int inner_value
def test_function(x, y):
"""
>>> test_function(1, 2)
3
>>> test_function(9, 16)
25
"""
return A_func(x, y)
def test_nested():
"""
>>> test_nested()
10
100
"""
print outer_value
print inner_value
namespace outer {
int x = 10;
int outer_value = 10;
namespace inner {
int x = 100;
int inner_value = 100;
}
}
namespace A {
typedef int A_t;
A_t A_func(A_t first, A_t second) {
return first + second;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment