X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=test%2Fdata%2Fdecoder.cpp;fp=test%2Fdata%2Fdecoder.cpp;h=0000000000000000000000000000000000000000;hb=6e89374a6796f8d5d9cc61b0a2f7e98562a034ae;hp=6a48fb04709637f636db6989d8045170e5253d40;hpb=ce94e4fd5d7ab666259231d21759613f1f2b93ee;p=pulseview.git diff --git a/test/data/decoder.cpp b/test/data/decoder.cpp deleted file mode 100644 index 6a48fb0..0000000 --- a/test/data/decoder.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2013 Joel Holdsworth - * - * This program 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 2 of the License, or - * (at your option) any later version. - * - * This program 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 St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include /* First, so we avoid a _POSIX_C_SOURCE warning. */ -#include - -#include - -#include "../../pv/data/decoder.h" -#include "../../pv/devicemanager.h" -#include "../../pv/sigsession.h" -#include "../../pv/view/decodetrace.h" - -using namespace boost; -using namespace std; - -BOOST_AUTO_TEST_SUITE(DecoderTest) - -BOOST_AUTO_TEST_CASE(TwoDecoder) -{ - using namespace pv; - - sr_context *ctx = NULL; - - BOOST_REQUIRE(sr_init(&ctx) == SR_OK); - BOOST_REQUIRE(ctx); - - BOOST_REQUIRE(srd_init(NULL) == SRD_OK); - - srd_decoder_load_all(); - - { - pv::DeviceManager dm(ctx); - pv::SigSession ss(dm); - - const GSList *l = srd_decoder_list(); - BOOST_REQUIRE(l); - srd_decoder *const dec = (struct srd_decoder*)l->data; - BOOST_REQUIRE(dec); - - ss.add_decoder(dec); - ss.add_decoder(dec); - - // Check the signals were created - const vector< shared_ptr > sigs = - ss.get_decode_signals(); - - shared_ptr dec0 = sigs[0]->decoder(); - BOOST_REQUIRE(dec0); - - shared_ptr dec1 = sigs[0]->decoder(); - BOOST_REQUIRE(dec1); - - // Wait for the decode threads to complete - dec0->_decode_thread.join(); - dec1->_decode_thread.join(); - - // Check there were no errors - BOOST_CHECK_EQUAL(dec0->error_message().isEmpty(), true); - BOOST_CHECK_EQUAL(dec1->error_message().isEmpty(), true); - } - - - srd_exit(); - sr_exit(ctx); -} - -BOOST_AUTO_TEST_SUITE_END()