summaryrefslogtreecommitdiffstats
path: root/tests/test_addnewconn.c
blob: a8acbfd9e12bacf25c1e154a30452f3a887f5b47 (plain) (blame)
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
40
41
42
#include <stdio.h>
 #include "../PICA_node.h"

struct newconn* add_newconn(struct newconn *ncs,int *pos);

struct newconn t1[64];


int main()
{
int tpos=0,i;
struct newconn *nc;

printf("    t1=%X\n",t1);

nc=add_newconn(t1,&tpos);
printf("1) nc=%X  tpos=%i\n",nc,tpos);

tpos=0;
t1[0].sck=1;

nc=add_newconn(t1,&tpos);
printf("2) nc=%X  tpos=%i\n",nc,tpos);

tpos=64;
nc=add_newconn(t1,&tpos);
printf("3) nc=%X  tpos=%i\n",nc,tpos);

for (i=0;i<64;i++)
{
t1[i].sck=65536;
t1[i].tmst=100+i;
}

t1[63].tmst=5;

nc=add_newconn(t1,&tpos);
printf("4) nc=%X  tpos=%i\n",nc,tpos);


return 0;
}