Debian Codegraph @

Nasal/test_frame_utils.nut

raw
1 #---------------------------------------------------------------------------
2 #
3 # Title : FRAME UTILS tests
4 #
5 # File Type : Unit test
6 #
7 # Author : Richard Harrison ([email protected])
8 #
9 # Creation Date : 24 October 2020
10 #
11 # Copyright (C) 2020 Richard Harrison Released under GPL V2
12 #
13 #---------------------------------------------------------------------------*/
14
15 # fgcommand("nasal-test", props.Node.new({"path":"test_frame_utils.nut"}));
16
17 var setUp = func {
18 logprint(LOG_INFO, "frame_utils test started");
19 };
20
21 # same, cab be ommitted
22 var tearDown = func {
23 logprint(LOG_INFO, "frame_utils test finished");
24 };
25
26 test_partitionProcessorTest = func {
27 var tt = maketimestamp();
28 tt.stamp();
29 var xx= PartitionProcessor.new("TEST", 54, tt);
30 xx.set_max_time_usec(100);
31 var obj = xx;
32
33 for (ii=0;ii<5;ii+=1) {
34 xx.process(obj, awg_9.tgts_list,
35 func(pp, obj, data){
36 print("init");
37 obj.designated = 0;
38 obj.active_found = 0;
39 obj.searchCallsign = nil;
40 if (awg_9.active_u != nil and awg_9.active_u.Callsign != nil)
41 obj.searchCallsign = awg_9.active_u.Callsign.getValue();
42 },
43 func(pp, obj, u){
44 printf("%-5d : %s",obj.data_index, u.Callsign.getValue());
45 var v = 0;
46 for (var idx=0;idx < 20; idx += 1) {
47 # getprop("orientation/heading-deg");
48 }
49 return 1;
50 },
51 func(pp, obj, data)
52 {
53 print("Completed\n");
54 }
55 );
56 }
57 }
58
59 #partitionProcessorTest();