diff options
author | Scott Mosier <smosier@microsoft.com> | 2015-11-21 00:16:06 +0300 |
---|---|---|
committer | Scott Mosier <smosier@microsoft.com> | 2015-11-21 00:16:06 +0300 |
commit | a64c7a7843de38fac7434f1a9ee59ece9f4bdc3a (patch) | |
tree | f18fbba24788552b36605c59c7de1490d1b34ada /src/Native/Runtime/RhConfig.h | |
parent | 06f392fc679ec96da9ee8f2332abce56a54bb304 (diff) |
Fix runtime assert default behavior
Change the default to be console-oriented. This is better for
unattended test passes because it now prints to the console instead
of popping up a dialog box. You can get back to the old behavior
by setting RH_BreakOnAssert=0 in the environment or config file.
Diffstat (limited to 'src/Native/Runtime/RhConfig.h')
-rw-r--r-- | src/Native/Runtime/RhConfig.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Native/Runtime/RhConfig.h b/src/Native/Runtime/RhConfig.h index 2c66698c2..c95fc8583 100644 --- a/src/Native/Runtime/RhConfig.h +++ b/src/Native/Runtime/RhConfig.h @@ -56,12 +56,12 @@ private: public: -#define DEFINE_VALUE_ACCESSOR(_name) \ +#define DEFINE_VALUE_ACCESSOR(_name, defaultVal) \ UInt32 Get##_name() \ { \ if (m_uiConfigValuesRead & (1 << RCV_##_name)) \ return m_uiConfigValues[RCV_##_name]; \ - UInt32 uiValue = ReadConfigValue(L"RH_" L ## #_name); \ + UInt32 uiValue = ReadConfigValue(L"RH_" L ## #_name, defaultVal); \ m_uiConfigValues[RCV_##_name] = uiValue; \ m_uiConfigValuesRead |= 1 << RCV_##_name; \ return uiValue; \ @@ -69,26 +69,35 @@ public: #ifdef _DEBUG -#define DEBUG_CONFIG_VALUE(_name) DEFINE_VALUE_ACCESSOR(_name) +#define DEBUG_CONFIG_VALUE(_name) DEFINE_VALUE_ACCESSOR(_name, 0) +#define DEBUG_CONFIG_VALUE_WITH_DEFAULT(_name, defaultVal) DEFINE_VALUE_ACCESSOR(_name, defaultVal) #else #define DEBUG_CONFIG_VALUE(_name) +#define DEBUG_CONFIG_VALUE_WITH_DEFAULT(_name, defaultVal) #endif -#define RETAIL_CONFIG_VALUE(_name) DEFINE_VALUE_ACCESSOR(_name) +#define RETAIL_CONFIG_VALUE(_name) DEFINE_VALUE_ACCESSOR(_name, 0) +#define RETAIL_CONFIG_VALUE_WITH_DEFAULT(_name, defaultVal) DEFINE_VALUE_ACCESSOR(_name, defaultVal) #include "RhConfigValues.h" #undef DEBUG_CONFIG_VALUE #undef RETAIL_CONFIG_VALUE +#undef DEBUG_CONFIG_VALUE_WITH_DEFAULT +#undef RETAIL_CONFIG_VALUE_WITH_DEFAULT private: - UInt32 ReadConfigValue(_In_z_ const WCHAR *wszName); + UInt32 ReadConfigValue(_In_z_ const WCHAR *wszName, UInt32 uiDefault); enum RhConfigValue { #define DEBUG_CONFIG_VALUE(_name) RCV_##_name, #define RETAIL_CONFIG_VALUE(_name) RCV_##_name, +#define DEBUG_CONFIG_VALUE_WITH_DEFAULT(_name, defaultVal) RCV_##_name, +#define RETAIL_CONFIG_VALUE_WITH_DEFAULT(_name, defaultVal) RCV_##_name, #include "RhConfigValues.h" #undef DEBUG_CONFIG_VALUE #undef RETAIL_CONFIG_VALUE +#undef DEBUG_CONFIG_VALUE_WITH_DEFAULT +#undef RETAIL_CONFIG_VALUE_WITH_DEFAULT RCV_Count }; |