knuth-lfib-test.c 331 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "testutils.h"
#include "knuth-lfib.h"

int
test_main(void)
{
  struct knuth_lfib_ctx ctx;

  uint32_t a[2009];
  uint32_t x;
  unsigned m;
  
  knuth_lfib_init(&ctx, 310952);
  for (m = 0; m<2009; m++)
    knuth_lfib_get_array(&ctx, 1009, a);

  x = knuth_lfib_get(&ctx);
  if (x != 461390032)
    FAIL();

  SUCCESS();
}