diff options
Diffstat (limited to 'tests/print-to.h')
-rw-r--r-- | tests/print-to.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/print-to.h b/tests/print-to.h new file mode 100644 index 0000000..78cf574 --- /dev/null +++ b/tests/print-to.h @@ -0,0 +1,45 @@ +/* + * Copyright 2015 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, 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 <http://www.gnu.org/licenses/>. + * + * Authors: + * Charles Kerr <charles.kerr@canonical.com> + */ + +#ifndef INDICATOR_DATETIME_TESTS_PRINT_TO +#define INDICATOR_DATETIME_TESTS_PRINT_TO + +#include <algorithm> + +#include <datetime/appointment.h> + +namespace unity { +namespace indicator { +namespace datetime { + +/*** +**** PrintTo() functions for GTest to represent objects as strings +***/ + +void +PrintTo(const Alarm& alarm, std::ostream* os) +{ + *os << "{text:'" << alarm.text << "', audio_url:'" << alarm.audio_url << "', time:'"<<alarm.time.format("%F %T")<<"'}"; +} + +} // namespace datetime +} // namespace indicator +} // namespace unity + +#endif |