1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/sys/cpp_ctors
Hugues Larrive 3c465836f2 examples and tests: add atmega8 to relevent Makefile.ci
using dist/tools/insufficient_memory/add_insufficient_memory_board.sh
2023-07-11 21:22:02 +02:00
..
tests tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
app.config.test tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
main.c tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
Makefile tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
Makefile.ci examples and tests: add atmega8 to relevent Makefile.ci 2023-07-11 21:22:02 +02:00
README.md tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
tests-cpp_ctors-class.cpp tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
tests-cpp_ctors.cpp tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00
tests-cpp_ctors.h tests: move sys related applications to tests/sys/ subdirectory 2023-05-10 12:02:58 +02:00

The purpose of this test is to ensure that C++ constructors are executed properly during the startup of RIOT. This requires that the port calls constructors somewhere during C-library initialization. On newlib ports this is done by __libc_init_array(), other ports may need to manually iterate through the list of initializer functions (usually .init_array), and call each one in order.

There are three tests:

  • Global constructor
  • Static constructor
  • Local constructor

The global constructor test checks to see if the constructor of a global object has been run during the boot process. The static constructor test does the same, but for static object inside a function. The local constructor test checks that a locally created object does have its constructor run. The local constructor test will only fail if there is a significant problem with the C++ tool chain, since it does not rely on any external C++ support code.