safe_test.c revision 8688e7005afed694ca129d00d3cd73b32828804b
/*
* Copyright (C) 2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id$ */
/* ! \file */
#include <config.h>
#include <atf-c.h>
#include <stdio.h>
#include <string.h>
}
"\x00\x00\x00\x00", 4));
"\x00\x00\x00\x01", 4));
"\x00\x00\x00\x00", 4));
}
}
"\x00\x00\x00\x00", 4) == 0);
"\x00\x00\x00\x01", 4) < 0);
"\x00\x00\x00\x00", 4) > 0);
}
}
/* These should pass. */
isc_safe_memwipe(NULL, 0);
isc_safe_memwipe((void *) -1, 0);
/*
* isc_safe_memwipe(ptr, size) should function same as
* memset(ptr, 0, size);
*/
{
}
/*
* Boundary test.
*/
{
/*
* We wipe 3 elements on purpose, keeping the 4th in
* place.
*/
}
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
return (atf_no_error());
}