From 3c2a05f0fa0e9cbfc786d1079674ce43f630b104 Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Wed, 9 Jun 2010 18:10:08 -0700 Subject: Add a simple mock of the transient message class. --- src/cmdline/mocks/Makefile.am | 3 ++- src/cmdline/mocks/SConscript | 8 +++++++ src/cmdline/mocks/transient_message.h | 45 +++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/cmdline/mocks/transient_message.h (limited to 'src/cmdline') diff --git a/src/cmdline/mocks/Makefile.am b/src/cmdline/mocks/Makefile.am index ae933790..841c0a18 100644 --- a/src/cmdline/mocks/Makefile.am +++ b/src/cmdline/mocks/Makefile.am @@ -6,6 +6,7 @@ libcmdline_mocks_a_SOURCES = \ teletype.cc \ teletype.h \ terminal.cc \ - terminal.h + terminal.h \ + transient_message.h EXTRA_DIST = SConscript \ No newline at end of file diff --git a/src/cmdline/mocks/SConscript b/src/cmdline/mocks/SConscript index feae0fee..89ba80f9 100644 --- a/src/cmdline/mocks/SConscript +++ b/src/cmdline/mocks/SConscript @@ -4,6 +4,14 @@ Import('programs_env') srcs = map(File, [ ]) +programs_env.Dist( + 'teletype.cc', + 'teletype.h', + 'terminal.cc', + 'terminal.h', + 'transient_message.h', + ) + programs_env.Dist('Makefile.am', 'SConscript') Return('srcs') diff --git a/src/cmdline/mocks/transient_message.h b/src/cmdline/mocks/transient_message.h new file mode 100644 index 00000000..a62c24b7 --- /dev/null +++ b/src/cmdline/mocks/transient_message.h @@ -0,0 +1,45 @@ +/** \file transient_message.h */ // -*-c++-*- + + +// Copyright (C) 2010 Daniel Burrows +// +// 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; see the file COPYING. If not, write to +// the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +#ifndef APTITUDE_CMDLINE_MOCKS_TRANSIENT_MESSAGE_H +#define APTITUDE_CMDLINE_MOCKS_TRANSIENT_MESSAGE_H + +// Local includes: +#include + +// System includes: +#include + +namespace aptitude +{ + namespace cmdline + { + namespace mocks + { + class transient_message : public cmdline::transient_message + { + public: + MOCK_METHOD1(set_text, void(const std::wstring &)); + }; + } + } +} + +#endif // APTITUDE_CMDLINE_MOCKS_TRANSIENT_MESSAGE_H -- cgit v1.2.3