From c7bb19c55c7a902e25bdd33b0d49a2ddcf62e07a Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 22 Dec 2012 21:38:26 +0000 Subject: update C coding style to a more commonly used style git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c --- tests/test_cfg.c | 234 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 121 insertions(+), 113 deletions(-) (limited to 'tests/test_cfg.c') diff --git a/tests/test_cfg.c b/tests/test_cfg.c index ed6e8f1..4474889 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, 2011 Arthur de Jong + Copyright (C) 2007, 2009, 2011, 2012 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 @@ -33,15 +33,15 @@ static void test_xstrdup(void) { - static const char *foo="testString123"; + static const char *foo = "testString123"; char *bar; - bar=xstrdup(foo); + bar = xstrdup(foo); /* we should have a new value */ - assert(bar!=NULL); + assert(bar != NULL); /* the contents should be the same */ - assertstreq(foo,bar); + assertstreq(foo, bar); /* but the pointer should be different */ - assert(foo!=bar); + assert(foo != bar); /* free memory */ free(bar); } @@ -52,99 +52,107 @@ static void test_add_uris(void) int i; /* set up config */ cfg_defaults(&cfg); - assert(cfg.ldc_uris[0].uri==NULL); + assert(cfg.ldc_uris[0].uri == NULL); /* add a uri */ - add_uri(__FILE__,__LINE__,&cfg,"ldap://localhost"); - assert(cfg.ldc_uris[0].uri!=NULL); - assert(cfg.ldc_uris[1].uri==NULL); + add_uri(__FILE__, __LINE__, &cfg, "ldap://localhost"); + assert(cfg.ldc_uris[0].uri != NULL); + assert(cfg.ldc_uris[1].uri == NULL); /* add some more uris */ - for (i=1;i