commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11438 - gnuradio/trunk/pmt/src/lib


From: eb
Subject: [Commit-gnuradio] r11438 - gnuradio/trunk/pmt/src/lib
Date: Tue, 14 Jul 2009 19:23:39 -0600 (MDT)

Author: eb
Date: 2009-07-14 19:23:38 -0600 (Tue, 14 Jul 2009)
New Revision: 11438

Modified:
   gnuradio/trunk/pmt/src/lib/qa_pmt_prims.cc
   gnuradio/trunk/pmt/src/lib/qa_pmt_prims.h
Log:
Add some unit test for pmt_subsetp and pmt_memq. (c1261 from Stefan 
Br?\195?\188ns)


Modified: gnuradio/trunk/pmt/src/lib/qa_pmt_prims.cc
===================================================================
--- gnuradio/trunk/pmt/src/lib/qa_pmt_prims.cc  2009-07-15 01:21:59 UTC (rev 
11437)
+++ gnuradio/trunk/pmt/src/lib/qa_pmt_prims.cc  2009-07-15 01:23:38 UTC (rev 
11438)
@@ -413,3 +413,24 @@
   // FIXME add tests for malformed input too.
 
 }
+
+void
+qa_pmt_prims::test_sets()
+{
+  pmt_t s1 = pmt_intern("s1");
+  pmt_t s2 = pmt_intern("s2");
+  pmt_t s3 = pmt_intern("s3");
+
+  pmt_t l1 = pmt_list1(s1);
+  pmt_t l2 = pmt_list2(s2,s3);
+  pmt_t l3 = pmt_list3(s1,s2,s3);
+
+  CPPUNIT_ASSERT(pmt_is_pair(pmt_memq(s1,l1)));
+  CPPUNIT_ASSERT(pmt_is_false(pmt_memq(s3,l1)));
+
+  CPPUNIT_ASSERT(pmt_subsetp(l1,l3));
+  CPPUNIT_ASSERT(pmt_subsetp(l2,l3));
+  CPPUNIT_ASSERT(!pmt_subsetp(l1,l2));
+  CPPUNIT_ASSERT(!pmt_subsetp(l2,l1));
+  CPPUNIT_ASSERT(!pmt_subsetp(l3,l2));
+}

Modified: gnuradio/trunk/pmt/src/lib/qa_pmt_prims.h
===================================================================
--- gnuradio/trunk/pmt/src/lib/qa_pmt_prims.h   2009-07-15 01:21:59 UTC (rev 
11437)
+++ gnuradio/trunk/pmt/src/lib/qa_pmt_prims.h   2009-07-15 01:23:38 UTC (rev 
11438)
@@ -42,6 +42,7 @@
   CPPUNIT_TEST(test_io);
   CPPUNIT_TEST(test_lists);
   CPPUNIT_TEST(test_serialize);
+  CPPUNIT_TEST(test_sets);
   CPPUNIT_TEST_SUITE_END();
 
  private:
@@ -59,6 +60,7 @@
   void test_io();
   void test_lists();
   void test_serialize();
+  void test_sets();
 };
 
 #endif /* INCLUDED_QA_PMT_PRIMS_H */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]