diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-03-17 22:02:45 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-03-17 22:02:45 +0100 |
commit | 2927aaa0b3796443821fff5b9043faafe2ffd542 (patch) | |
tree | 51a473df88935b47d0d02acf9b3a18db835517c3 /tests/test_cfg.c | |
parent | 6e8eef9c1636bfbeeed1a46c4af8221f285c6a90 (diff) |
put all assertion functions and compatibility code into one header file
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1397 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests/test_cfg.c')
-rw-r--r-- | tests/test_cfg.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/tests/test_cfg.c b/tests/test_cfg.c index dc558c2..810d024 100644 --- a/tests/test_cfg.c +++ b/tests/test_cfg.c @@ -2,7 +2,7 @@ test_cfg.c - simple test for the cfg module This file is part of the nss-pam-ldapd library. - Copyright (C) 2007, 2009 Arthur de Jong + Copyright (C) 2007, 2009, 2011 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,29 +26,11 @@ #include <string.h> #include <assert.h> +#include "common.h" + /* we include cfg.c because we want to test the static methods */ #include "nslcd/cfg.c" -#ifndef __ASSERT_FUNCTION -#define __ASSERT_FUNCTION "" -#endif /* not __ASSERT_FUNCTION */ - -#define assertstreq(str1,str2) \ - (assertstreq_impl(str1,str2,"strcmp(" __STRING(str1) "," __STRING(str2) ")==0", \ - __FILE__, __LINE__, __ASSERT_FUNCTION)) - -/* for Solaris: */ -#define __assert_fail(assertion,file,line,function) __assert(assertion,file,line) - -/* method for determening string equalness */ -static void assertstreq_impl(const char *str1,const char *str2, - const char *assertion,const char *file, - int line,const char *function) -{ - if (strcmp(str1,str2)!=0) - __assert_fail(assertion,file,line,function); -} - static void test_xstrdup(void) { static const char *foo="testString123"; |