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
2bb76871
Commit
2bb76871
authored
Jul 08, 2015
by
Ian Henriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more tests for assignment.
parent
1006500a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
tests/run/cpp_assignment_overload.srctree
tests/run/cpp_assignment_overload.srctree
+8
-0
No files found.
tests/run/cpp_assignment_overload.srctree
View file @
2bb76871
...
...
@@ -24,6 +24,10 @@ public:
this->val = other.val;
return *this;
}
wrapped_int &operator=(const long long val) {
this->val = val;
return *this;
}
};
...
...
@@ -35,6 +39,7 @@ cdef extern from "assign.cpp" nogil:
wrapped_int()
wrapped_int(long long val)
wrapped_int& operator=(const wrapped_int &other)
wrapped_int& operator=(const long long &other)
######## assignment_overload.pyx ########
...
...
@@ -44,6 +49,7 @@ from assign cimport wrapped_int
def test():
cdef wrapped_int a = wrapped_int(2)
cdef wrapped_int b = wrapped_int(3)
cdef long long c = 4
assert &a != &b
assert a.val != b.val
...
...
@@ -51,3 +57,5 @@ def test():
a = b
assert &a != &b
assert a.val == b.val
a = c
assert a.val == c
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