StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
test.C
1 {
2  gSystem.Load("St_base");
3  Int_t first = 111;
4  Int_t second = 222;
5  St_Module defmodule;
6  printf(" The module with NO parameter has been created: <%s> \n",defmodule.CheckParameters()? "Failed" : "Ok" );
7  module = new St_Module(&first);
8  printf(" Module with 1 parameters is <%s> \n",module->CheckParameters()? "Failed" : "Ok" );
9  module();
10  printf(" \n ------ \n The Warning message should follow:\n");
11  defmodule((ULong_t *)0,&second);
12  printf(" \n ------ \n The Error message should follow:\n");
13  printf(" Check Parameters: %d \n",defmodule->CheckParameters());
14  defmodule();
15  printf(" \n ------ \n 2 <good> messages expected: \n");
16  module((ULong_t *)0,&second);
17  module();
18  module((ULong_t *)0,&second,(ULong_t *)0,(ULong_t *)0,&first,&second);
19  module->CheckParameters();
20  const Char_t *name[]= {"First", "Second"};
21  module->CheckParameters(name);
22 
23  printf("Checking the post-module diagnostics\n");
24  table_head_st h1;
25  table_head_st h2;
26  // Everything Ok;
27  h1.maxlen=10;
28  h1.nok = 2;
29 
30  h2.maxlen=12;
31  h2.nok = 3;
32 
33  module_check = new St_Module((ULong_t *)&h1,&first,(ULong_t *)&h2,&second);
34  printf("Everything Ok!\n");
35  Int_t res = module_check();
36  module_check->CheckResults(res,name);
37 
38  h1.nok = h1.maxlen;
39  printf("First header is wrong!\n");
40  module_check->CheckResults(res,name);
41 
42  h2.nok = h2.maxlen+2;
43  Int_t res = module_check();
44  printf("First header and second one are wrong!\n");
45  module_check->CheckResults(res,name);
46  delete module_check;
47  delete module;
48 }