~ubuntu-branches/ubuntu/raring/heimdal/raring

« back to all changes in this revision

Viewing changes to lib/roken/tsearch-test.c

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-07-21 17:40:58 UTC
  • mfrom: (1.1.12 upstream) (2.4.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110721174058-byiuowgocek307cs
Tags: 1.5~pre2+git20110720-2
Fix dependency on pthreads when building on Linux 3.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        { "=", 1 },
74
74
        { NULL }
75
75
    };
76
 
    
 
76
 
77
77
    for(t = tests; t->string; t++) {
78
78
        /* Better not be there */
79
79
        p = (struct node *)rk_tfind((void *)t, (void **)&rootnode,
80
80
                                    node_compare);
81
 
        
 
81
 
82
82
        if (p) {
83
83
            warnx("erroneous list: found %d\n", p->order);
84
84
            numerr++;
85
85
        }
86
 
        
 
86
 
87
87
        /* Put node into the tree. */
88
88
        p = (struct node *) rk_tsearch((void *)t, (void **)&rootnode,
89
89
                                       node_compare);
90
 
        
 
90
 
91
91
        if (!p) {
92
92
            warnx("erroneous list: missing %d\n", t->order);
93
93
            numerr++;
94
94
        }
95
95
    }
96
 
    
 
96
 
97
97
    rk_twalk(rootnode, list_node);
98
 
    
 
98
 
99
99
    for(t = tests; t->string; t++) {
100
100
        /* Better be there */
101
101
        p =  (struct node *) rk_tfind((void *)t, (void **)&rootnode,
102
102
                                      node_compare);
103
 
        
 
103
 
104
104
        if (!p) {
105
105
            warnx("erroneous list: missing %d\n", t->order);
106
106
            numerr++;
107
107
        }
108
 
        
 
108
 
109
109
        /* pull out node */
110
110
        (void) rk_tdelete((void *)t, (void **)&rootnode,
111
111
                          node_compare);
112
 
        
 
112
 
113
113
        /* Better not be there */
114
114
        p =  (struct node *) rk_tfind((void *)t, (void **)&rootnode,
115
115
                                      node_compare);
116
 
        
 
116
 
117
117
        if (p) {
118
118
            warnx("erroneous list: found %d\n", p->order);
119
119
            numerr++;
120
120
        }
121
 
        
 
121
 
122
122
    }
123
 
    
 
123
 
124
124
    return numerr;
125
125
}