[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6996 - gnuradio/branches/developers/eb/gcell/src/lib
From: |
eb |
Subject: |
[Commit-gnuradio] r6996 - gnuradio/branches/developers/eb/gcell/src/lib |
Date: |
Sun, 18 Nov 2007 23:37:42 -0700 (MST) |
Author: eb
Date: 2007-11-18 23:37:40 -0700 (Sun, 18 Nov 2007)
New Revision: 6996
Added:
gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.cc
gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.h
Modified:
gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am
gnuradio/branches/developers/eb/gcell/src/lib/qa_lib.cc
Log:
basic QA code for jd_stack
Modified: gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am 2007-11-19
05:43:39 UTC (rev 6995)
+++ gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am 2007-11-19
06:37:40 UTC (rev 6996)
@@ -32,7 +32,8 @@
libgcell_qa_la_SOURCES = \
- qa_lib.cc
+ qa_lib.cc \
+ qa_jd_stack.cc
libgcell_qa_la_LIBADD = \
libgcell.la \
Added: gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.cc
(rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.cc
2007-11-19 06:37:40 UTC (rev 6996)
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "qa_jd_stack.h"
+#include <cppunit/TestAssert.h>
+#include "gc_jd_stack.h"
+#include <stdio.h>
+
+
+
+static const int NJDS = 8;
+static gc_jd_stack_t stack;
+static gc_job_desc_t jds[NJDS];
+
+// no brainer, single threaded basic checkout
+void
+qa_jd_stack::t1()
+{
+ // N.B., stack allocated stuff doesn't obey ((aligned (N))) attributes
+ //const int NJDS = 8;
+ //gc_jd_stack_t stack;
+ //gc_job_desc_t jds[NJDS];
+
+ //printf("&stack = %p\n", &stack);
+ //printf("&jds[0] = %p\n", &jds[0]);
+ //printf("&jds[1] = %p\n", &jds[1]);
+
+ CPPUNIT_ASSERT(((uintptr_t) &stack & 0x7f) == 0);
+ CPPUNIT_ASSERT(((uintptr_t) &jds[0] & 0x7f) == 0);
+ CPPUNIT_ASSERT(((uintptr_t) &jds[1] & 0x7f) == 0);
+
+ gc_jd_stack_init(&stack);
+
+ CPPUNIT_ASSERT(gc_jd_stack_pop(&stack) == 0);
+
+ for (int i = 0; i < NJDS; i++)
+ gc_jd_stack_push(&stack, &jds[i]);
+
+ for (int i = 0; i < NJDS; i++)
+ CPPUNIT_ASSERT_EQUAL(&jds[NJDS - i - 1], gc_jd_stack_pop(&stack));
+
+ CPPUNIT_ASSERT(gc_jd_stack_pop(&stack) == 0);
+}
+
+// FIXME multithreaded (running on PPE)
+void
+qa_jd_stack::t2()
+{
+}
Property changes on:
gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Added: gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.h
(rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.h 2007-11-19
06:37:40 UTC (rev 6996)
@@ -0,0 +1,42 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_QA_JD_STACK_H
+#define INCLUDED_QA_JD_STACK_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_jd_stack : public CppUnit::TestCase {
+
+ CPPUNIT_TEST_SUITE(qa_jd_stack);
+ CPPUNIT_TEST(t1);
+ CPPUNIT_TEST(t2);
+ CPPUNIT_TEST_SUITE_END();
+
+ private:
+ void t1();
+ void t2();
+
+};
+
+
+
+#endif /* INCLUDED_QA_JD_STACK_H */
Property changes on: gnuradio/branches/developers/eb/gcell/src/lib/qa_jd_stack.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: gnuradio/branches/developers/eb/gcell/src/lib/qa_lib.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/qa_lib.cc 2007-11-19
05:43:39 UTC (rev 6995)
+++ gnuradio/branches/developers/eb/gcell/src/lib/qa_lib.cc 2007-11-19
06:37:40 UTC (rev 6996)
@@ -26,14 +26,14 @@
*/
#include <qa_lib.h>
-// #include <qa_jd_stack.h>
+#include <qa_jd_stack.h>
CppUnit::TestSuite *
qa_lib::suite()
{
CppUnit::TestSuite *s = new CppUnit::TestSuite("general");
- // s->addTest(qa_jd_stack::suite());
+ s->addTest(qa_jd_stack::suite());
return s;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6996 - gnuradio/branches/developers/eb/gcell/src/lib,
eb <=