ASSERT_EQ(0, dlclose(handle)); // this test verifies atexit call from atexit handler. as well as the order of calls
ASSERT_EQ("Humpty Dumpty sat on a wall", atexit_call_sequence);
ASSERT_TRUE(valid_this_in_static_dtor);
ASSERT_TRUE(attr_dtor_called);
}
class TestMainStaticDtorClass { public:
TestMainStaticDtorClass() {
expected_this = this;
}
~TestMainStaticDtorClass() { if (this != expected_this) {
fprintf(stderr, "\nerror: static d-tor called with incorrect this pointer: %p, expected: %p\n", this, expected_this);
} else {
fprintf(stderr, "6");
}
} private: staticconst TestMainStaticDtorClass* expected_this;
};
staticvoid atexit_main() { // This should result in "123456" output to stderr static TestMainStaticDtorClass static_obj;
atexit(atexit_func5);
atexit(atexit_func3);
atexit(atexit_func2);
atexit(atexit_func1); exit(0);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.