dev-ros/message_filters: Fix building tests
authorAlexis Ballier <aballier@gentoo.org>
Sat, 25 Feb 2017 09:24:31 +0000 (10:24 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Sat, 25 Feb 2017 09:54:54 +0000 (10:54 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

dev-ros/message_filters/files/tests.patch [new file with mode: 0644]
dev-ros/message_filters/message_filters-1.13.0.ebuild
dev-ros/message_filters/message_filters-9999.ebuild

diff --git a/dev-ros/message_filters/files/tests.patch b/dev-ros/message_filters/files/tests.patch
new file mode 100644 (file)
index 0000000..2861213
--- /dev/null
@@ -0,0 +1,132 @@
+Index: message_filters/test/test_approximate_time_policy.cpp
+===================================================================
+--- message_filters.orig/test/test_approximate_time_policy.cpp
++++ message_filters/test/test_approximate_time_policy.cpp
+@@ -106,8 +106,8 @@ public:
+   {
+     //printf("Call_back called\n");
+     //printf("Call back: <%f, %f>\n", p->header.stamp.toSec(), q->header.stamp.toSec());
+-    ASSERT_TRUE(p);
+-    ASSERT_TRUE(q);
++    ASSERT_TRUE(p!=NULL);
++    ASSERT_TRUE(q!=NULL);
+     ASSERT_LT(output_position_, output_.size());
+     EXPECT_EQ(output_[output_position_].first, p->header.stamp);
+     EXPECT_EQ(output_[output_position_].second, q->header.stamp);
+@@ -164,10 +164,10 @@ public:
+   {
+     //printf("Call_back called\n");
+     //printf("Call back: <%f, %f>\n", p->header.stamp.toSec(), q->header.stamp.toSec());
+-    ASSERT_TRUE(p);
+-    ASSERT_TRUE(q);
+-    ASSERT_TRUE(r);
+-    ASSERT_TRUE(s);
++    ASSERT_TRUE(p!=NULL);
++    ASSERT_TRUE(q!=NULL);
++    ASSERT_TRUE(r!=NULL);
++    ASSERT_TRUE(s!=NULL);
+     ASSERT_LT(output_position_, output_.size());
+     EXPECT_EQ(output_[output_position_].time[0], p->header.stamp);
+     EXPECT_EQ(output_[output_position_].time[1], q->header.stamp);
+Index: message_filters/test/test_chain.cpp
+===================================================================
+--- message_filters.orig/test/test_chain.cpp
++++ message_filters/test/test_chain.cpp
+@@ -148,8 +148,8 @@ TEST(Chain, retrieveFilter)
+   c.addFilter(boost::make_shared<PassThrough<Msg> >());
+-  ASSERT_TRUE(c.getFilter<PassThrough<Msg> >(0));
+-  ASSERT_FALSE(c.getFilter<PassThrough<Msg> >(1));
++  ASSERT_TRUE(c.getFilter<PassThrough<Msg> >(0) != NULL);
++  ASSERT_FALSE(c.getFilter<PassThrough<Msg> >(1) != NULL);
+ }
+ TEST(Chain, retrieveFilterThroughBaseClass)
+@@ -161,8 +161,8 @@ TEST(Chain, retrieveFilterThroughBaseCla
+   c.addFilter(boost::make_shared<PassThrough<Msg> >());
+-  ASSERT_TRUE(cb->getFilter<PassThrough<Msg> >(0));
+-  ASSERT_FALSE(cb->getFilter<PassThrough<Msg> >(1));
++  ASSERT_TRUE(cb->getFilter<PassThrough<Msg> >(0) != NULL);
++  ASSERT_FALSE(cb->getFilter<PassThrough<Msg> >(1) != NULL);
+ }
+ struct PTDerived : public PassThrough<Msg>
+@@ -174,8 +174,8 @@ TEST(Chain, retrieveBaseClass)
+ {
+   Chain<Msg> c;
+   c.addFilter(boost::make_shared<PTDerived>());
+-  ASSERT_TRUE(c.getFilter<PassThrough<Msg> >(0));
+-  ASSERT_TRUE(c.getFilter<PTDerived>(0));
++  ASSERT_TRUE(c.getFilter<PassThrough<Msg> >(0) != NULL);
++  ASSERT_TRUE(c.getFilter<PTDerived>(0) != NULL);
+ }
+ int main(int argc, char **argv){
+Index: message_filters/test/test_exact_time_policy.cpp
+===================================================================
+--- message_filters.orig/test/test_exact_time_policy.cpp
++++ message_filters/test/test_exact_time_policy.cpp
+@@ -187,8 +187,8 @@ TEST(ExactTime, eventInEventOut)
+   sync.add<0>(evt);
+   sync.add<1>(evt);
+-  ASSERT_TRUE(h.e1_.getMessage());
+-  ASSERT_TRUE(h.e2_.getMessage());
++  ASSERT_TRUE(h.e1_.getMessage()!=NULL);
++  ASSERT_TRUE(h.e2_.getMessage()!=NULL);
+   ASSERT_EQ(h.e1_.getReceiptTime(), evt.getReceiptTime());
+   ASSERT_EQ(h.e2_.getReceiptTime(), evt.getReceiptTime());
+ }
+Index: message_filters/test/test_subscriber.cpp
+===================================================================
+--- message_filters.orig/test/test_subscriber.cpp
++++ message_filters/test/test_subscriber.cpp
+@@ -152,7 +152,7 @@ TEST(Subscriber, singleNonConstCallback)
+   ros::spinOnce();
+-  ASSERT_TRUE(h.msg_);
++  ASSERT_TRUE(h.msg_!=NULL);
+   ASSERT_EQ(msg.get(), h.msg_.get());
+ }
+@@ -169,8 +169,8 @@ TEST(Subscriber, multipleNonConstCallbac
+   ros::spinOnce();
+-  ASSERT_TRUE(h.msg_);
+-  ASSERT_TRUE(h2.msg_);
++  ASSERT_TRUE(h.msg_ !=NULL);
++  ASSERT_TRUE(h2.msg_!=NULL);
+   EXPECT_NE(msg.get(), h.msg_.get());
+   EXPECT_NE(msg.get(), h2.msg_.get());
+   EXPECT_NE(h.msg_.get(), h2.msg_.get());
+@@ -189,8 +189,8 @@ TEST(Subscriber, multipleCallbacksSomeFi
+   ros::spinOnce();
+-  ASSERT_TRUE(h.msg_);
+-  ASSERT_TRUE(h2.msg_);
++  ASSERT_TRUE(h.msg_ != NULL);
++  ASSERT_TRUE(h2.msg_!= NULL);
+   EXPECT_NE(msg.get(), h.msg_.get());
+   EXPECT_NE(msg.get(), h2.msg_.get());
+   EXPECT_NE(h.msg_.get(), h2.msg_.get());
+Index: message_filters/test/time_synchronizer_unittest.cpp
+===================================================================
+--- message_filters.orig/test/time_synchronizer_unittest.cpp
++++ message_filters/test/time_synchronizer_unittest.cpp
+@@ -516,8 +516,8 @@ TEST(TimeSynchronizer, eventInEventOut)
+   sync.add<0>(evt);
+   sync.add<1>(evt);
+-  ASSERT_TRUE(h.e1_.getMessage());
+-  ASSERT_TRUE(h.e2_.getMessage());
++  ASSERT_TRUE(h.e1_.getMessage()!=NULL);
++  ASSERT_TRUE(h.e2_.getMessage()!=NULL);
+   ASSERT_EQ(h.e1_.getReceiptTime(), evt.getReceiptTime());
+   ASSERT_EQ(h.e2_.getReceiptTime(), evt.getReceiptTime());
+ }
index 3ad28cabe8e337f95e3166a0ddabebb1e1b8e0b5..c858f9711d77bceef44553c12fca668edff3fa89 100644 (file)
@@ -31,3 +31,4 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
                dev-python/nose[${PYTHON_USEDEP}]
        )"
+PATCHES=( "${FILESDIR}/tests.patch" )
index 6295f1a041160e8ba4c02cb3f420f0bd919a5aaf..c858f9711d77bceef44553c12fca668edff3fa89 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -31,3 +31,4 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
                dev-python/nose[${PYTHON_USEDEP}]
        )"
+PATCHES=( "${FILESDIR}/tests.patch" )