3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "qa_gcell_general.h"
23 #include <cppunit/TestAssert.h>
26 #include <stdlib.h> // random, posix_memalign
29 #include <gcell/gc_job_manager.h>
32 // handle to embedded SPU executable
33 extern spe_program_handle_t gcell_general_qa_spx;
36 gcp_qa_general_submit(gc_job_manager_sptr mgr, const std::string &proc_name)
38 gc_proc_id_t proc_id = mgr->lookup_proc(proc_name);
39 gc_job_desc_sptr jd = gc_job_manager::alloc_job_desc(mgr);
41 jd->proc_id = proc_id;
46 if (!mgr->submit_job(jd.get())){
47 gc_job_status_t s = jd->status;
48 throw gc_bad_submit(proc_name, s);
55 qa_gcell_general::generic_test_body(const std::string &proc_name)
58 opts.program_handle = gc_program_handle_from_address(&gcell_general_qa_spx);
60 gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
62 gc_job_desc_sptr jd = gcp_qa_general_submit(mgr, proc_name);
63 if (!mgr->wait_job(jd.get())){
64 fprintf(stderr, "wait_job for %s failed: %s\n",
66 gc_job_status_string(jd->status).c_str());
70 return jd->output.arg[0].u32; // bool result from SPE code
74 * ------------------------------------------------------------------------
75 * Add more calls to SPE QA code here...
76 * ------------------------------------------------------------------------
79 qa_gcell_general::test_memset()
81 CPPUNIT_ASSERT(generic_test_body("qa_memset"));