summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-06-02 10:13:12 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-06-02 10:13:12 +0000
commit080d4ef15674d5dea03c6e0450a91374c7adf530 (patch)
tree234436abf75ca8de877d1e648c71ba3f84407699 /tests
parenta786ff2f3c2f4e69e2b765e1087530d84d36a78b (diff)
downloadATCD-080d4ef15674d5dea03c6e0450a91374c7adf530.tar.gz
ChangeLogTag: Fri Jun 2 09:42:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>Fri Jun 2 10:02:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/Config_Test.cpp43
-rw-r--r--tests/Config_Test.h4
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/Config_Test.cpp b/tests/Config_Test.cpp
index 4cf08965fcb..01bc3bf97bf 100644
--- a/tests/Config_Test.cpp
+++ b/tests/Config_Test.cpp
@@ -1081,6 +1081,28 @@ iniCompare (ACE_Configuration_Heap& fromFile, ACE_Configuration_Heap& original)
return rc;
}
+// change a network section value
+int Config_Test::change_one (ACE_Configuration &cfg, u_int a)
+{
+ ACE_Configuration_Section_Key root = cfg.root_section ();
+ ACE_Configuration_Section_Key NetworkSection;
+ ACE_Configuration_Section_Key LoggerSection;
+ ACE_Configuration_Section_Key BinarySection;
+
+ if (cfg.open_section (root,
+ ACE_TEXT ("network"),
+ 1,
+ NetworkSection))
+ return -1;
+
+ if (cfg.set_integer_value (NetworkSection,
+ ACE_TEXT ("TimeToLive"),
+ a))
+ return -2;
+
+ return 0;
+}
+
// Used to test INI Import Export class
int
@@ -1333,6 +1355,27 @@ Config_Test::testRegFormat ()
ACE_TEXT ("equal original (%d)\n"),
rc),
-1);
+
+ // 7.1 Change a value and test NOT equal case
+ change_one (original, 101);
+ if (fromFile == original)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("not pass value change test (%d)\n"),
+ rc),
+ -1);
+ }
+
+ // 7.2 change value back, they should be equal now
+ change_one (original, 100);
+ if (fromFile != original)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("not pass value change test (%d)\n"),
+ rc),
+ -1);
+ }
+
}// end if heap could not be opened.
else
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/tests/Config_Test.h b/tests/Config_Test.h
index 4736d93575e..30c75432d61 100644
--- a/tests/Config_Test.h
+++ b/tests/Config_Test.h
@@ -47,7 +47,11 @@ public:
// 8. Clean-up
int testRegFormat ();
+
private:
+ // change a value for value change test
+ int change_one (ACE_Configuration &l, u_int a = 101);
+
void get_section_string (ACE_Configuration& config,
ACE_Configuration_Section_Key& SectionKey,
const ACE_TCHAR* pszName,