#include "fresh_list_block.h"
#include "fresh_list_block_test.h"

/**
 * performs a series of tests and returns on the first error
 * with a corresponding error code
 */
int fresh_list_block_test::test() {
  // test the constructor and the getters
  fresh_list_block fresh_blk_1 (1, 0);

  if((fresh_blk_1.get_table_index() != 1)
      || (fresh_blk_1.get_next() != 0))
    return TFB_INIT_ERROR;

  // test the setter
  fresh_list_block fresh_blk_2 (0, &fresh_blk_1);

  if((fresh_blk_1.set_next(&fresh_blk_2) != &fresh_blk_2)
      || (fresh_blk_1.get_next() != &fresh_blk_2))
    return TFB_SET_NEXT_ERROR;

  return TFB_OK;
}

