mem_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2015, 2016 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/.
*/
#include <config.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <atf-c.h>
#include "isctest.h"
static void *
if (size == 0U)
size = 1;
}
static void
}
}
int i;
/* Local alloc, free */
if (result != ISC_R_SUCCESS)
goto out;
for (i = 0; i < 100000; i++) {
void *ptr;
}
printf("total_before=%lu, total_after=%lu, total_diff=%lu\n",
(unsigned long)diff);
/* 2048 +8 bytes extra for size_info */
/* ISC_MEMFLAG_INTERNAL */
for (i = 0; i < 100000; i++) {
void *ptr;
}
printf("total_before=%lu, total_after=%lu, total_diff=%lu\n",
(unsigned long)diff);
/* 2048 +8 bytes extra for size_info */
out:
isc_test_end();
}
}
void *ptr;
if (result != ISC_R_SUCCESS)
goto out;
printf("inuse_before=%lu, inuse_during=%lu, inuse_after=%lu\n",
(unsigned long)after);
ATF_REQUIRE_EQ(diff, 0);
out:
isc_test_end();
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
return (atf_no_error());
}