source: trunk/t3q-examples/checkLogFormat/checkLogFormat.ttcn3 @ 39

Last change on this file since 39 was 39, checked in by phdmakk, 14 years ago

+ improved log format example

File size: 1.8 KB
Line 
1module checkLogFormatModule {
2
3    function f_1 ()
4    runs on myComponent {
5
6        //incorrect
7        log ( "***" )
8    }
9
10
11    const integer c_1 := 1;
12
13    testcase t_sendMsg ()
14    runs on myComponent {
15
16                //this should also be correct
17                log("*** t_sendMsg: INFO: Unknown component " & p_variable & " ***");
18                f_2 ();
19
20        // correct
21        log ( "*** t_sendMsg: INFO: Wrong message has been received ***" )
22        f_1 (); //if this statement were absent
23                //and subsequent log processing enabled
24                //the above log sattement will be analyzed
25                //together with the following split log statements
26
27        // also correct, given subsequent log processing is enabled
28        log ( "*** t_sendMsg: " );
29        log ( "INFO: " );
30        log ( "Wrong message has been received ***" );
31        f_1 ();
32
33        //correct , given subsequent log processing is enabled
34        log ( "*** t_sendMsg: " );
35        log ( "INFO: " );
36        log ( f_2 () );
37        log ( "Wrong message has been received ***" );
38        f_1 ();
39
40        // some simple malformed log statements
41        //will be combined as one if subsequent log processing is enabled
42        log ( "*** : INFORMATION: Wrong message has been received ***" )
43        log ( "** t_sendMsg: INFO: Wrong message has been received **" )
44        log ( "*** t_sendMsg22: INFO: Wrong message has been received ***" )
45        log ( "*** t_sendMsg: INFORMATION: Wrong message has been received ***" )
46
47        //correct under different configuration / not combined with the above
48        log ( "*** INFO: Wrong message has been received ***" );
49    }
50
51    control {
52
53        //incorrect
54        log ( ".." );
55
56        //correct, if not combined with the above
57        log ( "*** t_sendMsg22: INFO: Wrong message has been received ***" )
58    }
59}
Note: See TracBrowser for help on using the repository browser.