This commit is contained in:
@ -34,14 +34,14 @@ IAT_BEGIN_BLOCK(Core, Environment)
|
||||
// -------------------------------------------------------------------------
|
||||
// 1. Basic Set and Get (The Happy Path)
|
||||
// -------------------------------------------------------------------------
|
||||
BOOL TestBasicCycle()
|
||||
bool TestBasicCycle()
|
||||
{
|
||||
// 1. Ensure clean slate
|
||||
Environment::Unset(TEST_KEY);
|
||||
IAT_CHECK_NOT(Environment::Exists(TEST_KEY));
|
||||
|
||||
// 2. Set
|
||||
BOOL setRes = Environment::Set(TEST_KEY, TEST_VAL);
|
||||
bool setRes = Environment::Set(TEST_KEY, TEST_VAL);
|
||||
IAT_CHECK(setRes);
|
||||
IAT_CHECK(Environment::Exists(TEST_KEY));
|
||||
|
||||
@ -62,7 +62,7 @@ BOOL TestBasicCycle()
|
||||
// -------------------------------------------------------------------------
|
||||
// 2. Overwriting Values
|
||||
// -------------------------------------------------------------------------
|
||||
BOOL TestOverwrite()
|
||||
bool TestOverwrite()
|
||||
{
|
||||
Environment::Set(TEST_KEY, "ValueA");
|
||||
IAT_CHECK_EQ(Environment::Get(TEST_KEY), String("ValueA"));
|
||||
@ -78,12 +78,12 @@ BOOL TestOverwrite()
|
||||
// -------------------------------------------------------------------------
|
||||
// 3. Unset Logic
|
||||
// -------------------------------------------------------------------------
|
||||
BOOL TestUnset()
|
||||
bool TestUnset()
|
||||
{
|
||||
Environment::Set(TEST_KEY, "To Be Deleted");
|
||||
IAT_CHECK(Environment::Exists(TEST_KEY));
|
||||
|
||||
BOOL unsetRes = Environment::Unset(TEST_KEY);
|
||||
bool unsetRes = Environment::Unset(TEST_KEY);
|
||||
IAT_CHECK(unsetRes);
|
||||
|
||||
// Verify it is actually gone
|
||||
@ -99,7 +99,7 @@ BOOL TestUnset()
|
||||
// -------------------------------------------------------------------------
|
||||
// 4. Default Value Fallbacks
|
||||
// -------------------------------------------------------------------------
|
||||
BOOL TestDefaults()
|
||||
bool TestDefaults()
|
||||
{
|
||||
const char *ghostKey = "IA_THIS_KEY_DOES_NOT_EXIST";
|
||||
|
||||
@ -122,7 +122,7 @@ BOOL TestDefaults()
|
||||
// -------------------------------------------------------------------------
|
||||
// Does Set(Key, "") create an existing empty variable, or unset it?
|
||||
// Standard POSIX/Windows API behavior is that it EXISTS, but is empty.
|
||||
BOOL TestEmptyValue()
|
||||
bool TestEmptyValue()
|
||||
{
|
||||
Environment::Set(TEST_KEY, "");
|
||||
|
||||
@ -149,14 +149,14 @@ BOOL TestEmptyValue()
|
||||
// -------------------------------------------------------------------------
|
||||
// 6. Validation / Bad Input
|
||||
// -------------------------------------------------------------------------
|
||||
BOOL TestBadInput()
|
||||
bool TestBadInput()
|
||||
{
|
||||
// Setting an empty key should fail gracefully
|
||||
BOOL res = Environment::Set("", "Value");
|
||||
bool res = Environment::Set("", "Value");
|
||||
IAT_CHECK_NOT(res);
|
||||
|
||||
// Unsetting an empty key should fail
|
||||
BOOL resUnset = Environment::Unset("");
|
||||
bool resUnset = Environment::Unset("");
|
||||
IAT_CHECK_NOT(resUnset);
|
||||
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user