Add wxModule::AreInitialized()

This internal function will be useful to check if the modules are
already initialized, i.e. if the library is in the "steady state"
between the end of the initialization and the beginning of the cleanup
phases.
This commit is contained in:
Vadim Zeitlin
2021-03-07 20:37:09 +01:00
parent fbd23270e3
commit 5ddf57c150
3 changed files with 22 additions and 1 deletions

View File

@@ -15,6 +15,8 @@
#include "wx/module.h"
#include "wx/wxcrt.h" // for wxStrcat()
static bool gs_wasInitialized = wxModule::AreInitialized();
// ----------------------------------------------------------------------------
// test classes derived from wxModule
// ----------------------------------------------------------------------------
@@ -89,6 +91,12 @@ ModuleD::ModuleD()
// tests themselves
// ----------------------------------------------------------------------------
TEST_CASE("wxModule::Initialized", "[module]")
{
CHECK( !gs_wasInitialized );
CHECK( wxModule::AreInitialized() );
}
TEST_CASE("wxModule::LoadOrder", "[module]")
{
// module D is the only one with no dependencies and so should load as first (and so on):