test for no bidders
This commit is contained in:
parent
37ac9545eb
commit
257d5b72b0
2
brandt.c
2
brandt.c
@ -107,7 +107,7 @@ seller_start (void *arg)
|
||||
if (0 == (ad->n = ad->start (ad->closure)))
|
||||
{
|
||||
weprintf ("no bidders registered for auction");
|
||||
/** todo: somehow mark auction as done / ready for cleanup */
|
||||
ad->result (ad->closure, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,9 @@ expected_outcome (uint16_t i)
|
||||
uint16_t winners = MIN (tcase.m, tcase.n);
|
||||
uint16_t cur_winner = 0;
|
||||
|
||||
if (0 == tcase.n)
|
||||
return NULL;
|
||||
|
||||
if (0 == tcase.m)
|
||||
{
|
||||
for (uint16_t h = 0; h < tcase.n; h++)
|
||||
@ -379,6 +382,10 @@ main (int argc, char *argv[])
|
||||
BRANDT_init (edc);
|
||||
|
||||
ret |= 0 ||
|
||||
test_auction (0, 2, NULL, 0, 0) ||
|
||||
test_auction (0, 2, NULL, 0, 1) ||
|
||||
test_auction (0, 2, NULL, 1, 0) ||
|
||||
test_auction (0, 2, NULL, 2, 0) ||
|
||||
test_auction (2, 2, (uint16_t[]) { 1, 0 }, 1, 0) ||
|
||||
test_auction (3, 2, (uint16_t[]) { 0, 0, 1 }, 2, 0) ||
|
||||
test_auction (3, 2, (uint16_t[]) { 0, 1, 1 }, 0, 0) ||
|
||||
|
Loading…
Reference in New Issue
Block a user