1212 */
1313// =============================================================================
1414
15-
1615#include " test_config.h"
1716#include " Config_Test.h"
1817#include " ace/Configuration_Import_Export.h"
@@ -95,10 +94,10 @@ test (ACE_Configuration *config,
9594 else if (intvalue != 42 )
9695 return -9 ;
9796
98- u_char * data_out ( 0 ) ;
97+ u_char* data_out {} ;
9998
10099 {
101- void * data_tmp = 0 ; // Workaround for GCC strict aliasing warning.
100+ void * data_tmp {} ; // Workaround for GCC strict aliasing warning.
102101 size_t length = 0 ;
103102
104103 if (config->get_binary_value (testsection,
@@ -244,8 +243,7 @@ test (ACE_Configuration *config,
244243static int
245244test (ACE_Configuration *config)
246245{
247- const ACE_Configuration_Section_Key& root =
248- config->root_section ();
246+ const ACE_Configuration_Section_Key& root = config->root_section ();
249247
250248 {
251249 // Scope this so the testsection key is closed before trying to
@@ -258,7 +256,7 @@ test (ACE_Configuration *config)
258256 testsection))
259257 return -2 ;
260258
261- int ret_val = test (config, testsection);
259+ int const ret_val = test (config, testsection);
262260 if (ret_val)
263261 return ret_val;
264262 }
@@ -302,18 +300,17 @@ test (ACE_Configuration *config)
302300static int
303301test_subkey_path (ACE_Configuration* config)
304302{
305- ACE_Configuration_Section_Key root =
306- config->root_section ();
303+ ACE_Configuration_Section_Key root = config->root_section ();
307304
308305 ACE_Configuration_Section_Key testsection;
309306
310307 if (config->open_section (root,
311- ACE_TEXT (" Software\\ ACE \\ test" ),
308+ ACE_TEXT (" Software\\ ACETEST \\ test" ),
312309 1 ,
313310 testsection))
314311 return -26 ;
315312
316- int ret_val = test (config, testsection);
313+ int const ret_val = test (config, testsection);
317314 if (ret_val)
318315 return ret_val;
319316
@@ -324,7 +321,7 @@ test_subkey_path (ACE_Configuration* config)
324321 return -27 ;
325322
326323 if (config->remove_section (testsection,
327- ACE_TEXT (" ACE " ),
324+ ACE_TEXT (" ACETEST " ),
328325 1 ))
329326 return -28 ;
330327
@@ -525,34 +522,32 @@ run_tests ()
525522
526523#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
527524 {
528- ACE_Configuration_Win32Registry RegConfig (HKEY_LOCAL_MACHINE );
529- int result = test_subkey_path (& RegConfig);
525+ ACE_Configuration_Win32Registry RegConfig (HKEY_CURRENT_USER );
526+ int const result = test_subkey_path (std::addressof ( RegConfig) );
530527 if (result)
531528 ACE_ERROR_RETURN ((LM_ERROR,
532- ACE_TEXT (" Win32Registry test HKEY_LOCAL_MACHINE " )
529+ ACE_TEXT (" Win32Registry test HKEY_CURRENT_USER " )
533530 ACE_TEXT (" failed (%d)\n " ), result),
534531 -1 );
535532 }
536533 // test win32 registry implementation.
537- HKEY root =
538- ACE_Configuration_Win32Registry::resolve_key (HKEY_LOCAL_MACHINE,
539- ACE_TEXT (" Software\\ ACE\\ test" ));
534+ HKEY const root = ACE_Configuration_Win32Registry::resolve_key (HKEY_CURRENT_USER,
535+ ACE_TEXT (" Software\\ ACETEST\\ test" ));
540536 if (!root)
541537 ACE_ERROR_RETURN ((LM_ERROR,
542538 ACE_TEXT (" resolve_key is broken\n " )), -2 );
543539
544540 // test resolving of forward slashes
545- HKEY root_fs =
546- ACE_Configuration_Win32Registry::resolve_key (HKEY_LOCAL_MACHINE,
547- ACE_TEXT (" Software/ACE/test" ), 0 );
541+ HKEY const root_fs = ACE_Configuration_Win32Registry::resolve_key (HKEY_CURRENT_USER,
542+ ACE_TEXT (" Software/ACETEST/test" ), 0 );
548543 if (!root_fs)
549544 ACE_ERROR_RETURN ((LM_ERROR,
550545 ACE_TEXT (" resolve_key resolving slashes is broken\n " )),
551546 -2 );
552547
553548 ACE_Configuration_Win32Registry RegConfig (root);
554549 {
555- int const result = test (& RegConfig);
550+ int const result = test (std::addressof ( RegConfig) );
556551 if (result)
557552 ACE_ERROR_RETURN ((LM_ERROR,
558553 ACE_TEXT (" Win32 registry test root failed (%d)\n " ),
@@ -585,7 +580,7 @@ run_tests ()
585580 -1 );
586581 }
587582 {
588- int result = test_subkey_path (& heap_config);
583+ int const result = test_subkey_path (std::addressof ( heap_config) );
589584 if (result)
590585 ACE_ERROR_RETURN ((LM_ERROR,
591586 ACE_TEXT (" Heap Config subkey test failed (%d)\n " ),
@@ -594,7 +589,7 @@ run_tests ()
594589 }
595590
596591 {
597- int result = test (& heap_config);
592+ int const result = test (std::addressof ( heap_config) );
598593 if (result)
599594 ACE_ERROR_RETURN ((LM_ERROR,
600595 ACE_TEXT (" Heap Configuration test failed (%d)\n " ),
@@ -642,7 +637,7 @@ run_tests ()
642637 }
643638
644639 {
645- int result = test (& pers_config);
640+ int const result = test (std::addressof ( pers_config) );
646641 if (result)
647642 ACE_ERROR_RETURN ((LM_ERROR,
648643 ACE_TEXT (" Persistent Heap Config test failed (%d)\n " ),
@@ -748,7 +743,7 @@ build_config_object (ACE_Configuration& cfg)
748743 -16 );
749744
750745 ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" here\n " )));
751- // return 0;
746+
752747 // ACE_TString string;
753748 ACE_TString name ((ACE_TCHAR*)0 );
754749 if (cfg.get_string_value (LoggerSection,
0 commit comments