Revision b3dd32b0

View differences:

som/Tests/Makefile
17 17
        topology_test_attr \
18 18
        chunk_encoding_test \
19 19
        chunk_sending_test \
20
	chunk_signaling_test \
20
        chunk_signaling_test \
21 21
        chunkidset_test \
22
        chunkidset_test_bug \
22 23
        cb_test \
23 24
        config_test \
24 25
        tman_test
......
43 44

  
44 45
chunkidset_test: chunkidset_test.o chunkid_set_h.o
45 46

  
47
chunkidset_test_bug: chunkidset_test_bug.o chunkid_set_h.o
48

  
46 49
chunk_sending_test: chunk_sending_test.o net_helpers.o
47 50
chunk_sending_test: ../net_helper.o
48 51

  
som/Tests/chunkidset_test_bug.c
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
}

Also available in: Unified diff