summaryrefslogtreecommitdiff
path: root/tests/test_expr.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-03-17 21:02:45 +0000
committerArthur de Jong <arthur@arthurdejong.org>2011-03-17 21:02:45 +0000
commit2927aaa0b3796443821fff5b9043faafe2ffd542 (patch)
tree51a473df88935b47d0d02acf9b3a18db835517c3 /tests/test_expr.c
parent6e8eef9c1636bfbeeed1a46c4af8221f285c6a90 (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_expr.c')
-rw-r--r--tests/test_expr.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/tests/test_expr.c b/tests/test_expr.c
index dfc00cb..2032296 100644
--- a/tests/test_expr.c
+++ b/tests/test_expr.c
@@ -2,7 +2,7 @@
test_expr.c - simple tests for the expr module
This file is part of the nss-pam-ldapd library.
- Copyright (C) 2009 Arthur de Jong
+ Copyright (C) 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 expr.c because we want to test the static methods */
#include "common/expr.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_parse_name(void)
{
char buffer[20];