mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
912ce16d0c
(This demo does NOT involve smart pointers at all, unlike the otherwise similar test_smart_ptr_private_first_base.)
19 lines
394 B
Python
19 lines
394 B
Python
# -*- coding: utf-8 -*-
|
|
import pytest
|
|
|
|
from pybind11_tests import private_first_base as m
|
|
|
|
|
|
def test_make_drvd_pass_base():
|
|
d = m.make_drvd()
|
|
i = m.pass_base(d)
|
|
assert i == 200
|
|
|
|
|
|
def test_make_drvd_up_cast_pass_drvd():
|
|
b = m.make_drvd_up_cast()
|
|
# the base return is down-cast immediately.
|
|
assert b.__class__.__name__ == "drvd"
|
|
i = m.pass_drvd(b)
|
|
assert i == 200
|