2025-02-24 10:18:03 +08:00
|
|
|
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
2023-04-06 11:44:13 +08:00
|
|
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
|
|
|
import pytest
|
|
|
|
from pytest_embedded_idf.dut import IdfDut
|
2025-02-24 10:18:03 +08:00
|
|
|
from pytest_embedded_idf.utils import idf_parametrize
|
2023-04-06 11:44:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.generic
|
2025-02-24 10:18:03 +08:00
|
|
|
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
2023-04-06 11:44:13 +08:00
|
|
|
def test_cpp_rtti_example(dut: IdfDut) -> None:
|
|
|
|
dut.expect_exact('Type name of std::cout is: std::ostream')
|
|
|
|
dut.expect_exact('Type name of std::cin is: std::istream')
|
|
|
|
dut.expect_exact('Type of app_main is: void ()')
|
|
|
|
dut.expect_exact('Type name of a lambda function is: app_main::{lambda(int, int)#1}')
|
|
|
|
|
|
|
|
dut.expect_exact('dynamic_cast<DerivedA*>(obj)=0')
|
|
|
|
dut.expect_exact('dynamic_cast<DerivedB*>(obj)=0x')
|
|
|
|
dut.expect_exact('dynamic_cast<DerivedB*>(obj)=0')
|
|
|
|
dut.expect_exact('dynamic_cast<DerivedA*>(obj)=0x')
|
|
|
|
|
|
|
|
dut.expect_exact('Example finished.')
|