
#include "config_xor.h"

#include <string.h>
#include "CuTest.h"
#include "samhain.h"

void Test_sl_snprintf (CuTest *tc) {

  int ret = 0;
  char input[16];

  memset (&input, 'X', 16);
  ret = sl_snprintf(input, 10, "%s\n", "01234567890123456789");
  CuAssertIntEquals(tc, ret, 0);
  CuAssertTrue(tc, input[9]  == '\0');
  CuAssertTrue(tc, input[10] == 'X');

  memset (&input, 'X', 16);
  ret = sl_snprintf(input, 4, "%d\n", "012345");
  CuAssertIntEquals(tc, ret, 0);
  CuAssertTrue(tc, input[3] == '\0');
  CuAssertTrue(tc, input[4] == 'X');
}


