refcount-tests.c revision 9fb59763bce293c2490e0b9f8e97bb1f74ba0910
/*
SSSD
Reference counting tests.
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 <stdlib.h>
#include <check.h>
#include <talloc.h>
#include <tevent.h>
#include <popt.h>
/* Interface under test */
#include "util/refcount.h"
/* Fail the test if object 'obj' does not have 'num' references. */
#define FILLER_SIZE 32
struct foo {
char a[FILLER_SIZE];
char b[FILLER_SIZE];
};
struct bar {
char a[FILLER_SIZE];
char b[FILLER_SIZE];
};
struct baz {
char a[FILLER_SIZE];
char b[FILLER_SIZE];
};
#define SET_FILLER(target) do { \
} while (0)
#define CHECK_FILLER(target) do { \
int _counter; \
} \
} while (0)
struct container {
};
{
struct container *containers;
int i;
/* First allocate our global storage place. */
/* Allocate foo. */
/* Allocate bar. */
/* Allocate baz. */
/* Try multiple attaches. */
for (i = 0; i < 100; i++) {
}
}
{
void *tmp_ctx;
struct container *container1;
struct container *container2;
/* Allocate. */
/* Reference. */
/* Make sure everything is as it should be. */
/* Free in reverse order. */
}
Suite *create_suite(void)
{
/* Do some testing */
/* Add all test cases to the test suite */
suite_add_tcase(s, tc);
return s;
}
{
int opt;
int failure_count;
int debug = 0;
struct poptOption long_options[] = {
};
switch(opt) {
default:
return 1;
}
}
debug_level = debug;
suite = create_suite();
/* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
}