Browse Source

Clean up compat_libevent tests

Nick Mathewson 8 years ago
parent
commit
ac8c5ec67a

+ 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
 };
+

File diff suppressed because it is too large
+ 24 - 16
src/test/test_compat_libevent.c


Some files were not shown because too many files changed in this diff