diff options
Diffstat (limited to 'tests/Config_Test.cpp')
-rw-r--r-- | tests/Config_Test.cpp | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/tests/Config_Test.cpp b/tests/Config_Test.cpp index b2cfdc760f8..30960c971c7 100644 --- a/tests/Config_Test.cpp +++ b/tests/Config_Test.cpp @@ -560,7 +560,7 @@ run_tests (void) ACE_Configuration_Win32Registry RegConfig (root); { - int result = test (&RegConfig); + int const result = test (&RegConfig); if (result) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Win32 registry test root failed (%d)\n"), @@ -573,8 +573,25 @@ run_tests (void) // Test Heap version ACE_Configuration_Heap heap_config; - if (heap_config.open ()) - return 0; + if (heap_config.open () != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Cannot open %p\n"), + ACE_TEXT ("local-heap config")), + -1); + if (heap_config.open () == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open heap allowed; bugzilla 3724\n")), + -1); + } + else if (errno != EBUSY) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open heap expected EBUSY (%d), ") + ACE_TEXT ("got %d: bugzilla 3724\n"), + EBUSY, ACE_ERRNO_GET), + -1); + } { int result = test_subkey_path (&heap_config); if (result) @@ -600,8 +617,37 @@ run_tests (void) if (pers_config.open (ACE_TEXT ("test.reg"))) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Cannot open test.reg\n")), + ACE_TEXT ("Cannot open %p\n"), + ACE_TEXT ("test.reg")), -1); + if (pers_config.open (ACE_TEXT ("test.reg")) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open(mmap) allowed; bugzilla 3724\n")), + -1); + } + else if (errno != EBUSY) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open(mmap) expected EBUSY (%d), ") + ACE_TEXT ("got %d: bugzilla 3724\n"), + EBUSY, ACE_ERRNO_GET), + -1); + } + if (pers_config.open () == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open(new) allowed; bugzilla 3724\n")), + -1); + } + else if (errno != EBUSY) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Re-open(new) expected EBUSY (%d), ") + ACE_TEXT ("got %d: bugzilla 3724\n"), + EBUSY, ACE_ERRNO_GET), + -1); + } { int result = test (&pers_config); @@ -1086,7 +1132,7 @@ iniCompare (ACE_Configuration_Heap& fromFile, ACE_Configuration_Heap& original) sectionName.c_str (), 0); // do not remove subsections. - sectionIndex++; + ++sectionIndex; }// end section while loop @@ -1096,7 +1142,7 @@ iniCompare (ACE_Configuration_Heap& fromFile, ACE_Configuration_Heap& original) (!original.enumerate_sections (originalRoot, sectionIndex, sectionName))) - sectionIndex++; + ++sectionIndex; rc = sectionIndex == 0; |