From 7f01386f63850d9e13afb4033d1fae39f6a03764 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 4 May 2011 18:36:10 -0700 Subject: uhd: replaced warning post with calls to UHD_MSG(warning) The message api can support warnings, error, and status messages. The default handler is to stdio, but the user can change this. --- host/tests/CMakeLists.txt | 2 +- host/tests/msg_test.cpp | 39 +++++++++++++++++++++++++++++++++++++++ host/tests/warning_test.cpp | 29 ----------------------------- 3 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 host/tests/msg_test.cpp delete mode 100644 host/tests/warning_test.cpp (limited to 'host/tests') diff --git a/host/tests/CMakeLists.txt b/host/tests/CMakeLists.txt index f08fe669b..b38afccf0 100644 --- a/host/tests/CMakeLists.txt +++ b/host/tests/CMakeLists.txt @@ -26,12 +26,12 @@ SET(test_sources dict_test.cpp error_test.cpp gain_group_test.cpp + msg_test.cpp ranges_test.cpp subdev_spec_test.cpp time_spec_test.cpp tune_helper_test.cpp vrt_test.cpp - warning_test.cpp wax_test.cpp ) diff --git a/host/tests/msg_test.cpp b/host/tests/msg_test.cpp new file mode 100644 index 000000000..495907504 --- /dev/null +++ b/host/tests/msg_test.cpp @@ -0,0 +1,39 @@ +// +// Copyright 2010-2011 Ettus Research LLC +// +// 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 3 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, see . +// + +#include +#include +#include + +BOOST_AUTO_TEST_CASE(test_messages){ + #ifdef UHD_FUTURE + std::cerr << "---begin print test ---" << std::endl; + UHD_MSG(status) << + "This is a test print for a status message.\n" + "And this is the second line of the test print.\n" + ; + UHD_MSG(warning) << + "This is a test print for a warning message.\n" + "And this is the second line of the test print.\n" + ; + UHD_MSG(error) << + "This is a test print for an error message.\n" + "And this is the second line of the test print.\n" + ; + std::cerr << "---end print test ---" << std::endl; + #endif +} diff --git a/host/tests/warning_test.cpp b/host/tests/warning_test.cpp deleted file mode 100644 index 3394f84d4..000000000 --- a/host/tests/warning_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright 2010-2011 Ettus Research LLC -// -// 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 3 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, see . -// - -#include -#include -#include - -BOOST_AUTO_TEST_CASE(test_warning_post){ - std::cerr << "---begin print test ---" << std::endl; - uhd::warning::post( - "This is a test print for a warning message.\n" - "And this is the second line of the test print.\n" - ); - std::cerr << "---end print test ---" << std::endl; -} -- cgit v1.2.3