From 2927aaa0b3796443821fff5b9043faafe2ffd542 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 17 Mar 2011 21:02:45 +0000 Subject: 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 --- tests/test_cfg.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'tests/test_cfg.c') 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 #include +#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"; -- cgit v1.2.3