apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/test CuTest.c CuTest.h test_apr.h testall.c testlock.c testrand.c testsockopt.c
Date Fri, 06 Dec 2002 16:32:18 GMT
rbb         2002/12/06 08:32:18

  Modified:    test     CuTest.c CuTest.h test_apr.h testall.c testlock.c
                        testrand.c testsockopt.c
  Log:
  Move CuAssertSuccess to apr_assert_success, and remove it from the
  CuTest sources.  This keeps the CuTest sources clean of any knowledge about
  APR.
  
  Revision  Changes    Path
  1.13      +0 -10     apr/test/CuTest.c
  
  Index: CuTest.c
  ===================================================================
  RCS file: /home/cvs/apr/test/CuTest.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CuTest.c	6 Dec 2002 11:44:01 -0000	1.12
  +++ CuTest.c	6 Dec 2002 16:32:17 -0000	1.13
  @@ -216,16 +216,6 @@
   	CuFail(tc, buf);
   }
   
  -void CuAssertSuccess(CuTest* tc, const char* context, apr_status_t rv)
  -{
  -	if (!APR_STATUS_IS_SUCCESS(rv)) {
  -		char buf[STRING_MAX], ebuf[128];
  -		sprintf(buf, "%s (%d): %s\n", context, rv,
  -			apr_strerror(rv, ebuf, sizeof ebuf));
  -		CuFail(tc, buf);
  -	}
  -}
  -
   void CuTestRun(CuTest* tc)
   {
   	jmp_buf buf;
  
  
  
  1.10      +0 -4      apr/test/CuTest.h
  
  Index: CuTest.h
  ===================================================================
  RCS file: /home/cvs/apr/test/CuTest.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CuTest.h	6 Dec 2002 11:44:01 -0000	1.9
  +++ CuTest.h	6 Dec 2002 16:32:18 -0000	1.10
  @@ -92,10 +92,6 @@
   void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual);
   void CuAssertPtrNotNull(CuTest* tc, const void* pointer);
   
  -/* Assert that RV is an APR_SUCCESS value; else fail giving strerror
  - * for RV and CONTEXT message. */
  -void CuAssertSuccess(CuTest* tc, const char *context, apr_status_t rv);
  -
   void CuTestRun(CuTest* tc);
   
   /* CuSuite */
  
  
  
  1.36      +5 -0      apr/test/test_apr.h
  
  Index: test_apr.h
  ===================================================================
  RCS file: /home/cvs/apr/test/test_apr.h,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- test_apr.h	6 Dec 2002 16:04:58 -0000	1.35
  +++ test_apr.h	6 Dec 2002 16:32:18 -0000	1.36
  @@ -93,4 +93,9 @@
   CuSuite *testthread(void);
   CuSuite *testgetopt(void);
   
  +/* Assert that RV is an APR_SUCCESS value; else fail giving strerror
  + * for RV and CONTEXT message. */
  +void apr_assert_success(CuTest* tc, const char *context, apr_status_t rv);
  +
  +
   #endif /* APR_TEST_INCLUDES */
  
  
  
  1.33      +10 -0     apr/test/testall.c
  
  Index: testall.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testall.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- testall.c	6 Dec 2002 16:04:58 -0000	1.32
  +++ testall.c	6 Dec 2002 16:32:18 -0000	1.33
  @@ -60,6 +60,16 @@
   /* Top-level pool which can be used by tests. */
   apr_pool_t *p;
   
  +void apr_assert_success(CuTest* tc, const char* context, apr_status_t rv)
  +{
  +    if (!APR_STATUS_IS_SUCCESS(rv)) {
  +        char buf[STRING_MAX], ebuf[128];
  +        sprintf(buf, "%s (%d): %s\n", context, rv,
  +                apr_strerror(rv, ebuf, sizeof ebuf));
  +        CuFail(tc, buf);
  +    }
  +}
  +
   static const struct testlist {
       const char *testname;
       CuSuite *(*func)(void);
  
  
  
  1.23      +5 -5      apr/test/testlock.c
  
  Index: testlock.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testlock.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- testlock.c	6 Dec 2002 13:35:36 -0000	1.22
  +++ testlock.c	6 Dec 2002 16:32:18 -0000	1.23
  @@ -222,20 +222,20 @@
       apr_status_t s1, s2, s3, s4;
   
       s1 = apr_thread_rwlock_create(&rwlock, p);
  -    CuAssertSuccess(tc, "rwlock_create", s1);
  +    apr_assert_success(tc, "rwlock_create", s1);
       CuAssertPtrNotNull(tc, rwlock);
   
       i = 0;
       x = 0;
   
       s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p);
  -    CuAssertSuccess(tc, "create thread 1", s1);
  +    apr_assert_success(tc, "create thread 1", s1);
       s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p);
  -    CuAssertSuccess(tc, "create thread 2", s2);
  +    apr_assert_success(tc, "create thread 2", s2);
       s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p);
  -    CuAssertSuccess(tc, "create thread 3", s3);
  +    apr_assert_success(tc, "create thread 3", s3);
       s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p);
  -    CuAssertSuccess(tc, "create thread 4", s4);
  +    apr_assert_success(tc, "create thread 4", s4);
   
       apr_thread_join(&s1, t1);
       apr_thread_join(&s2, t2);
  
  
  
  1.9       +1 -1      apr/test/testrand.c
  
  Index: testrand.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testrand.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- testrand.c	6 Dec 2002 13:35:36 -0000	1.8
  +++ testrand.c	6 Dec 2002 16:32:18 -0000	1.9
  @@ -72,7 +72,7 @@
        */
       for (i = 1; i <= 8; i++) {
           rv = apr_generate_random_bytes(c, i * 255);
  -        CuAssertSuccess(tc, "apr_generate_random_bytes failed", rv);
  +        apr_assert_success(tc, "apr_generate_random_bytes failed", rv);
       }
   #endif
   }    
  
  
  
  1.15      +1 -1      apr/test/testsockopt.c
  
  Index: testsockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testsockopt.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- testsockopt.c	6 Dec 2002 13:50:50 -0000	1.14
  +++ testsockopt.c	6 Dec 2002 16:32:18 -0000	1.15
  @@ -91,7 +91,7 @@
        * for get/set consistency of this option. */
       rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1);
       rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck);
  -    CuAssertSuccess(tc, "get SO_DEBUG option", rv2);
  +    apr_assert_success(tc, "get SO_DEBUG option", rv2);
       if (APR_STATUS_IS_SUCCESS(rv1)) {
           CuAssertIntEquals(tc, 1, ck);
       } else {
  
  
  

Mime
View raw message