blob: 7716341f923823a0bc5b977ec5cfc6b52e88c753 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include <string.h>
#define USE_MEM_SECURE
#define __STDC_WANT_LIB_EXT1__ 1
#include "../src/extlib.h"
int
test_memset_s ()
{
int errno = 0;
char *buf = malloc (100);
if (memset_s (buf, 100, 'a', 100) != 0)
errno = 1;
if (memvcmp (buf, 'a', 100) != 0)
errno = 2;
free_secure ((void **) &buf, 100);
return errno;
}
struct test_t*
test_memset_s_t ()
{
struct test_t* test = malloc (sizeof (struct test_t));
test->test_func = test_memset_s;
test->test_name = "test_memset_s";
test->test_desc = "memset_s";
return test;
}
|