Statistics
| Branch: | Revision:

grapes / som / Tests / chunkidset_test_bug.c @ b3dd32b0

History | View | Annotate | Download (861 Bytes)

1
/*
2
 *  Copyright (c) 2009 Luca Abeni
3
 *
4
 *  This is free software; see gpl-3.0.txt
5
 */
6

    
7
#include <stdint.h>
8
#include <stdlib.h>
9
#include <stdio.h>
10
#include <string.h>
11
#include "chunkidset.h"
12
#include "trade_sig_la.h"
13
#include "chunkid_set_h.h"
14

    
15
static void simple_test(void)
16
{
17
  struct chunkID_set *cset;
18
  char config[32];
19

    
20
  sprintf(config, "size=%d", 10);
21
  cset = chunkID_set_init(config);
22
  if(!cset) {
23
    fprintf(stderr, "Unable to allocate memory for rcset\n");
24

    
25
    return;
26
  }
27

    
28
  printf("Chunk ID Set initialised: size is %d\n", chunkID_set_size(cset));
29
  printChunkID_set(cset);
30
  printf("Earliest chunk %u\n", chunkID_set_get_earliest(cset));
31
  check_chunk(cset, 0);
32
  printf("Latest chunk %u.\n", chunkID_set_get_latest(cset));
33
  check_chunk(cset, 0);
34
  chunkID_set_free(cset);
35
}
36

    
37
int main(int argc, char *argv[])
38
{
39
  simple_test();
40

    
41
  return 0;
42
}