[tor-commits] [tor/master] Remove extra ; from tt_assert() macro definition.

nickm at torproject.org nickm at torproject.org
Thu Jan 9 12:32:53 UTC 2020


commit 73b83b8f1a92aee93543095c96ae59ed6ba064a2
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Dec 3 00:51:09 2019 -0500

    Remove extra ; from tt_assert() macro definition.
    
    We were actually omitting the semicolon in a few places, leading to
    confusing indentation and some cocci failures.
---
 src/ext/tinytest_macros.h      | 4 ++--
 src/test/test_circuitlist.c    | 2 +-
 src/test/test_config.c         | 8 ++++----
 src/test/test_dir_handle_get.c | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/ext/tinytest_macros.h b/src/ext/tinytest_macros.h
index c3728d1fd..6fc2cea2d 100644
--- a/src/ext/tinytest_macros.h
+++ b/src/ext/tinytest_macros.h
@@ -99,11 +99,11 @@
 
 /* Assert b, but do not stop the test if b fails.  Log msg on failure. */
 #define tt_want_msg(b, msg)			\
-	tt_want_(b, msg, );
+	tt_want_(b, msg, )
 
 /* Assert b and stop the test if b fails.  Log msg on failure. */
 #define tt_assert_msg(b, msg)			\
-	tt_want_(b, msg, TT_EXIT_TEST_FUNCTION);
+	tt_want_(b, msg, TT_EXIT_TEST_FUNCTION)
 
 /* Assert b, but do not stop the test if b fails. */
 #define tt_want(b)   tt_want_msg( (b), "want("#b")")
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 5cebdbeda..013b66b35 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -136,7 +136,7 @@ test_clist_maps(void *arg)
   channel_note_destroy_pending(ch2, 200);
   channel_note_destroy_pending(ch2, 205);
   channel_note_destroy_pending(ch1, 100);
-  tt_assert(circuit_id_in_use_on_channel(205, ch2))
+  tt_assert(circuit_id_in_use_on_channel(205, ch2));
   tt_assert(circuit_id_in_use_on_channel(200, ch2));
   tt_assert(circuit_id_in_use_on_channel(100, ch1));
 
diff --git a/src/test/test_config.c b/src/test/test_config.c
index 8f705da7e..512ccb85c 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -4680,7 +4680,7 @@ test_config_parse_port_config__ports__ports_given(void *data)
   port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
   tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
   tor_addr_parse(&addr, "127.0.0.46");
-  tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+  tt_assert(tor_addr_eq(&port_cfg->addr, &addr));
 
   // Test success with a port of auto in mixed case
   config_free_lines(config_port_valid); config_port_valid = NULL;
@@ -4694,7 +4694,7 @@ test_config_parse_port_config__ports__ports_given(void *data)
   port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
   tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
   tor_addr_parse(&addr, "127.0.0.46");
-  tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+  tt_assert(tor_addr_eq(&port_cfg->addr, &addr));
 
   // Test success with parsing both an address and an auto port
   config_free_lines(config_port_valid); config_port_valid = NULL;
@@ -4708,7 +4708,7 @@ test_config_parse_port_config__ports__ports_given(void *data)
   port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
   tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
   tor_addr_parse(&addr, "127.0.0.122");
-  tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+  tt_assert(tor_addr_eq(&port_cfg->addr, &addr));
 
   // Test failure when asked to parse an invalid address followed by auto
   config_free_lines(config_port_invalid); config_port_invalid = NULL;
@@ -4731,7 +4731,7 @@ test_config_parse_port_config__ports__ports_given(void *data)
   port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
   tt_int_op(port_cfg->port, OP_EQ, 656);
   tor_addr_parse(&addr, "127.0.0.123");
-  tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+  tt_assert(tor_addr_eq(&port_cfg->addr, &addr));
 
   // Test failure if we can't parse anything at all
   config_free_lines(config_port_invalid); config_port_invalid = NULL;
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 2b311a2f2..ffe904522 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -258,7 +258,7 @@ test_dir_handle_get_rendezvous2_not_found_if_not_encrypted(void *data)
   conn = new_dir_conn();
 
   // connection is not encrypted
-  tt_assert(!connection_dir_is_encrypted(conn))
+  tt_assert(!connection_dir_is_encrypted(conn));
 
   tt_int_op(directory_handle_command_get(conn, RENDEZVOUS2_GET(), NULL, 0),
             OP_EQ, 0);





More information about the tor-commits mailing list