Skip to content

Commit

Permalink
p3 consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Oct 15, 2017
1 parent 5b182a9 commit f94b4df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/test_boost_any.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test02_any_usage(self):

extract = boost.any_cast[std.vector[int]](std.move(val))
assert type(extract) is std.vector[int]
extract += xrange(100)
extract += range(100)

val.__assign__(std.move(extract))
assert len(extract) == 0
Expand Down
15 changes: 9 additions & 6 deletions test/test_cpp11features.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,30 @@ def moveit(T):
i2 = T(i1) # cctor
assert T.s_move_counter == 0

if is_pypy:
if is_pypy or 0x3000000 <= sys.hexversion:
i3 = T(std.move(T())) # can't check ref-count
else:
i3 = T(T()) # should call move, not memoized cctor
assert T.s_move_counter == 1

i4 = T(std.move(i1))
i3 = T(std.move(T())) # both move and ref-count
assert T.s_move_counter == 2

i4 = T(std.move(i1))
assert T.s_move_counter == 3

# move assignment
i4.__assign__(i2)
assert T.s_move_counter == 2
assert T.s_move_counter == 3

if is_pypy:
if is_pypy or 0x3000000 <= sys.hexversion:
i4.__assign__(std.move(T())) # can't check ref-count
else:
i4.__assign__(T())
assert T.s_move_counter == 3
assert T.s_move_counter == 4

i4.__assign__(std.move(i2))
assert T.s_move_counter == 4
assert T.s_move_counter == 5

# order of moving and normal functions are reversed in 1, 2, for
# overload resolution testing
Expand Down

0 comments on commit f94b4df

Please sign in to comment.