#include <error.h>
#include <fosa.h>
#include <stdio.h>
+#include <wvtest.h>
#define NUM_ORBS 5
#error This test should only work if there is some local protocol enabled.
#endif
-int main(int argc, char *argv[])
+WVTEST_MAIN("Automatic discovery of FORB servers")
{
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT
forb_orb orb[NUM_ORBS];
int i;
bool all_peers_found = true;
fosa_abs_time_t timeout;
- for (i=0; i<NUM_ORBS; i++) {
- orb[i] = forb_init(&argc, &argv, NULL);
- if (!orb[i]) {
- error(1, errno, "Orb no. %d was not created\n", i);
- }
- }
+ for (i=0; i<NUM_ORBS; i++)
+ WVPASS(orb[i] = forb_init(0, NULL, NULL));
fosa_clock_get_time(FOSA_CLOCK_ABSOLUTE, &timeout);
timeout = fosa_abs_time_incr(timeout,
forb_peer_t *peer;
for (j=0; j<NUM_ORBS && all_peers_found; j++) {
if (i==j) continue;
- peer = forb_peer_find_timed(forb_data(orb[i]),
- &forb_data(orb[j])->server_id,
- &timeout);
+ WVPASS(peer = forb_peer_find_timed(forb_data(orb[i]),
+ &forb_data(orb[j])->server_id,
+ &timeout));
all_peers_found &= (peer != NULL);
if (!all_peers_found) {
}
}
}
-
- printf("OK\n");
- return 0;
+#endif
}