summaryrefslogtreecommitdiff
path: root/ACE/tests/Bug_3319_Regression_Test.cpp
blob: ea6de0c632217eba65065c1b921680c6446c108b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
 * @file Bug_3319_Regression_Test.cpp
 *
 * $Id$
 *
 * Reproduces the problems reported in bug 2975:
 *   http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=3319
 */

#include "ace/ACE.h"
#include "test_config.h"
#include "ace/Service_Config.h"
#include "ace/ARGV.h"
#include "ace/Log_Msg.h"

int
run_main (int, ACE_TCHAR *[])
{
  ACE_START_TEST (ACE_TEXT ("Bug_3319_Regression_Test"));

  ACE_Log_Msg *log_msg = ACE_LOG_MSG;
  ACE_ARGV args;
  args.add (ACE_TEXT("MyProgram"), true);
  int ret = ACE_Service_Config::open(args.argc(), args.argv(),
                                     ACE_DEFAULT_LOGGER_KEY,
                                     1, 1, 1);

  if (ACE_OS::strcmp (log_msg->program_name (), ACE_TEXT("MyProgram")) != 0)
  {
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("Program name is not <MyProgram> but <%s>\n"),
                       ACE_Log_Msg::program_name ()),
                       1);
  }

  ACE_END_TEST;

  return ret;
}