Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
5edc00e7
Commit
5edc00e7
authored
Aug 27, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C++ namespace tests.
parent
7b39a311
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
tests/run/cpp_namespaces.pyx
tests/run/cpp_namespaces.pyx
+28
-0
tests/run/cpp_namespaces_helper.h
tests/run/cpp_namespaces_helper.h
+25
-0
No files found.
tests/run/cpp_namespaces.pyx
0 → 100644
View file @
5edc00e7
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
tests/run/cpp_namespaces_helper.h
0 → 100644
View file @
5edc00e7
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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment