sol2/tests/regression_tests/simple/source/main.cpp
ThePhD b9115623b2
Overhaul stack_field tableless handlers
- Ensure stack field_get/field_set has consistent metaprogramming for needing a pushed table, and at what offset
- Avoid duplicate logic in table_core for the same logic by deferring to detail helper
- Fixes #1095
2020-12-29 21:50:16 -05:00

34 lines
983 B
C++

#include <cstddef>
using f_ptr = unsigned int();
extern unsigned int regression_1000();
extern unsigned int regression_1008();
extern unsigned int regression_1067();
extern unsigned int regression_1072();
extern unsigned int regression_1087();
extern unsigned int regression_1095();
extern unsigned int regression_1096();
static f_ptr* const regression_tests_regressions[]
= { &regression_1008, &regression_1000, &regression_1067, &regression_1072, &regression_1087, &regression_1095, &regression_1096 };
static const int regression_tests_sizeof_regressions = sizeof(regression_tests_regressions) / sizeof(regression_tests_regressions[0]);
int trampoline(f_ptr* f) {
try {
return f();
}
catch (...) {
}
return 1;
}
int main(int, char*[]) {
int r = 0;
for (std::size_t i = 0; i < regression_tests_sizeof_regressions; ++i) {
f_ptr* f = regression_tests_regressions[i];
r += static_cast<int>(trampoline(f) != 0u);
}
return r;
}