Revision 534e126a src/Tests/topology_test.c

View differences:

src/Tests/topology_test.c
85 85
#define BUFFSIZE 1024
86 86
  static uint8_t buff[BUFFSIZE];
87 87
  int cnt = 0;
88
  
88

  
89 89
  psample_parse_data(context, NULL, 0);
90 90
  while (!done) {
91 91
    int len;
92 92
    int news;
93 93
    const struct timeval tout = {1, 0};
94 94
    struct timeval t1;
95
    char addr[256];
95 96

  
96 97
    t1 = tout;
97 98
    news = wait4data(s, &t1, NULL);
......
110 111
        neighbourhoods = psample_get_cache(context, &n);
111 112
        printf("I have %d neighbours:\n", n);
112 113
        for (i = 0; i < n; i++) {
113
          printf("\t%d: %s\n", i, node_addr(neighbourhoods[i]));
114
          node_addr(neighbourhoods[i], addr, 256);
115
          printf("\t%d: %s\n", i, addr);
114 116
        }
115 117
        fflush(stdout);
116 118
        if (fprefix) {
......
121 123
          f = fopen(fname, "w");
122 124
          if (f) fprintf(f, "#Cache size: %d\n", n);
123 125
          for (i = 0; i < n; i++) {
124
            if (f) fprintf(f, "%d\t\t%d\t%s\n", port, i, node_addr(neighbourhoods[i]));
126
            node_addr(neighbourhoods[i], addr, 256);
127
            if (f) fprintf(f, "%d\t\t%d\t%s\n", port, i, addr);
125 128
          }
126 129
          fclose(f);
127 130
        }

Also available in: Unified diff