/*
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>
#include "tests/common_check.h"
/* Interface under test */
#include "util/refcount.h"
/* Fail the test if object 'obj' does not have 'num' references. */
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];
};
} while (0)
int _counter; \
} \
} while (0)
struct container {
};
{
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;
/* Allocate. */
/* Reference. */
/* Make sure everything is as it should be. */
/* Free in reverse order. */
}
{
/* 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;
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
suite = create_suite();
/* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
}