소스 검색

Clean up compat_libevent tests

Nick Mathewson 9 년 전
부모
커밋
ac8c5ec67a
8개의 변경된 파일38개의 추가작업 그리고 19개의 파일을 삭제
  1. 3 0
      changes/17075
  2. 3 0
      changes/17084
  3. 1 0
      src/common/compat_libevent.c
  4. 1 2
      src/common/compat_libevent.h
  5. 4 1
      src/test/log_test_helpers.c
  6. 1 0
      src/test/log_test_helpers.h
  7. 1 0
      src/test/test.c
  8. 24 16
      src/test/test_compat_libevent.c

+ 3 - 0
changes/17075

@@ -0,0 +1,3 @@
+  o Testing:
+    - More unit tests for compat_libevent.c. Closes ticket 17075.
+      Patch from Ola Bini.

+ 3 - 0
changes/17084

@@ -0,0 +1,3 @@
+  o Testing:
+    - More unit tests for util_format.c. Closes ticket 17084.
+      Patch from Ola Bini.

+ 1 - 0
src/common/compat_libevent.c

@@ -626,3 +626,4 @@ tor_gettimeofday_cached_monotonic(struct timeval *tv)
     memcpy(&last_tv, tv, sizeof(struct timeval));
   }
 }
+

+ 1 - 2
src/common/compat_libevent.h

@@ -91,7 +91,6 @@ void tor_gettimeofday_cache_set(const struct timeval *tv);
 #endif
 void tor_gettimeofday_cached_monotonic(struct timeval *tv);
 
-
 #ifdef COMPAT_LIBEVENT_PRIVATE
 /** A number representing a version of Libevent.
 
@@ -121,7 +120,6 @@ typedef uint32_t le_version_t;
  * it is. */
 #define LE_OTHER V(0,0,99)
 
-
 STATIC void
 libevent_logging_callback(int severity, const char *msg);
 STATIC le_version_t
@@ -131,3 +129,4 @@ le_versions_compatibility(le_version_t v);
 #endif
 
 #endif
+

+ 4 - 1
src/test/log_test_helpers.c

@@ -1,3 +1,5 @@
+/* Copyright (c) 2015, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
 #define LOG_PRIVATE
 #include "torlog.h"
 #include "log_test_helpers.h"
@@ -37,7 +39,7 @@ static mock_saved_log_entry_t *
 mock_get_log_entry(int ix)
 {
   int saved_log_count = mock_saved_log_number();
-  if(ix < 0) {
+  if (ix < 0) {
     ix = saved_log_count + ix;
   }
 
@@ -106,3 +108,4 @@ mock_saving_logv(int severity, log_domain_mask_t domain,
     saved_logs = smartlist_new();
   smartlist_add(saved_logs, e);
 }
+

+ 1 - 0
src/test/log_test_helpers.h

@@ -28,3 +28,4 @@ int mock_saved_severity_at(int ix);
 int mock_saved_log_number(void);
 
 #endif
+

+ 1 - 0
src/test/test.c

@@ -1212,3 +1212,4 @@ struct testgroup_t testgroups[] = {
   { "dns/", dns_tests },
   END_OF_GROUPS
 };
+

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 24 - 16
src/test/test_compat_libevent.c


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.