File: Bug_3319_Regression_Test.cpp

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (39 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (2)
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: Bug_3319_Regression_Test.cpp 91673 2010-09-08 18:49:47Z johnnyw $
 *
 * 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;
}