File: test_util_createdatetime.c

package info (click to toggle)
portsentry 2.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,396 kB
  • sloc: ansic: 6,473; sh: 916; perl: 18; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <assert.h>
#include <string.h>

#include "../src/util.h"
#include "../src/portsentry.h"

void TestCreateDateTime(void);

void TestCreateDateTime(void) {
  char buffer[MIN_DATETIME_BUFFER];
  assert(CreateDateTime(buffer, sizeof(buffer)) == TRUE);

  assert(CreateDateTime(NULL, MIN_DATETIME_BUFFER) == ERROR);

  char small_buf[10];
  assert(CreateDateTime(small_buf, sizeof(small_buf)) == ERROR);
}

int main(void) {
  TestCreateDateTime();
  return 0;
}