/*
SSSD
Common utilities for check-based tests using talloc.
Authors:
Martin Nagy <mnagy@redhat.com>
Copyright (C) Red Hat, Inc 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "util/dlinklist.h"
struct size_snapshot {
};
fmt, ##__VA_ARGS__); \
} while(0);
const char *check_leaks_err_msg(void)
{
return leak_err_msg;
}
static bool
{
return false;
}
if (bytes_allocated != bytes) {
_set_leak_err_msg("%s: memory leaks detected, %zd bytes still allocated",
return false;
}
return true;
}
void
{
}
bool
{
return false;
}
if (snapshot_stack == NULL) {
return false;
}
_set_leak_err_msg("Bad push/pop order");
return false;
}
}
bool
leak_check_setup(void)
{
if (global_talloc_context == NULL) {
_set_leak_err_msg("talloc_new failed");
return false;
}
return true;
}
bool
leak_check_teardown(void)
{
bool res;
if (!res) {
_set_leak_err_msg("check_leaks_pop failed in leak_check_teardown");
}
if (snapshot_stack != NULL) {
_set_leak_err_msg("Exiting with a non-empty stack");
return false;
}
return res;
}