Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / tests / Bug_2975_Regression_Test.cpp
blobbf1bc2bd845fcd42598e71734af3c4e75d4b95b9
1 /**
2 * @file Bug_2975_Regression_Test.cpp
4 * Reproduces the problems reported in bug 2975:
5 * http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=2975
7 * @author Pavel Zaichenko <zaichep@mail.ru>
8 */
10 #include "ace/ACE.h"
11 #include "test_config.h"
12 #include "ace/Service_Config.h"
13 #include "ace/ARGV.h"
15 int
16 run_main (int, ACE_TCHAR *argv[])
18 ACE_START_TEST (ACE_TEXT ("Bug_2975_Regression_Test"));
20 int ret = 0;
22 ACE_ARGV args;
23 args.add (argv[0], true);
24 args.add (ACE_TEXT("-S"));
25 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
26 args.add (
27 ACE_TEXT ("\"dynamic ACE_Logger Service_Object * ")
28 ACE_TEXT ("ACE:_make_ACE_Logging_Strategy() ")
29 ACE_TEXT ("'-p ~TRACE|DEBUG|INFO|WARNING|NOTICE|ERROR|CRITICAL|ALERT'")
30 ACE_TEXT ("\""));
31 #else // not (ACE_USES_CLASSIC_SVC_CONF == 1)
32 args.add (
33 ACE_TEXT ("'<ACE_Svc_Conf>")
34 ACE_TEXT ("<dynamic id=\"ACE_Logger\"")
35 ACE_TEXT (" type=\"Service_Object\">")
36 ACE_TEXT ("<initializer path=\"ACE\"")
37 ACE_TEXT (" init=\"_make_ACE_Logging_Strategy\"")
38 ACE_TEXT (" params=\"-p ~TRACE|DEBUG|INFO|WARNING|NOTICE|ERROR|CRITICAL|ALERT\"/>")
39 ACE_TEXT ("</dynamic>")
40 ACE_TEXT ("</ACE_Svc_Conf>'"));
41 #endif // not (ACE_USES_CLASSIC_SVC_CONF == 1)
43 ret = ACE_Service_Config::open(args.argc(), args.argv(),
44 ACE_DEFAULT_LOGGER_KEY,
45 1, 1);
47 if (0 != ret)
49 ACE_ERROR ((LM_ERROR, ACE_TEXT ("ACE_Service_Config::open() failed\n")));
52 ACE_END_TEST;
54 return 0;