kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] branch master updated: [test] add 'do {} while ()' for NO_PENDING_FATALS
Date Tue, 24 Sep 2019 04:34:35 GMT
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new e64aa5f  [test] add 'do {} while ()' for NO_PENDING_FATALS
e64aa5f is described below

commit e64aa5f5ec401deaee47399e409bd3c5119b8efd
Author: Alexey Serbin <alexey@apache.org>
AuthorDate: Sun Sep 22 11:36:28 2019 -0700

    [test] add 'do {} while ()' for NO_PENDING_FATALS
    
    This patch adds 'do {} while ()' scope around the definition of the
    NO_PENDING_FATALS macro, unifying it with others from test_macros.h.
    
    The motivation for this change was seeing warnings on an empty statement
    generated by QtCreator IDE.
    
    Change-Id: Icc97db2b761fec44bfa8b45f81210fb09124b866
    Reviewed-on: http://gerrit.cloudera.org:8080/14278
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <adar@cloudera.com>
---
 src/kudu/util/test_macros.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/kudu/util/test_macros.h b/src/kudu/util/test_macros.h
index 393867d..b82c453 100644
--- a/src/kudu/util/test_macros.h
+++ b/src/kudu/util/test_macros.h
@@ -26,8 +26,9 @@
 
 // Detect fatals in the surrounding scope. NO_FATALS() only checks for fatals
 // in the expression passed to it.
-#define NO_PENDING_FATALS() \
-  if (testing::Test::HasFatalFailure()) { return; }
+#define NO_PENDING_FATALS() do { \
+  if (testing::Test::HasFatalFailure()) { return; } \
+} while (0)
 
 #define ASSERT_OK(status) do { \
   const Status& _s = status;        \


Mime
View raw message