LibreOffice Module test (master) 1
cppunitasserthelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
11#define INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
12
13#include <rtl/ustring.hxx>
14
15#include <com/sun/star/awt/Point.hpp>
16#include <com/sun/star/awt/Size.hpp>
17#include <com/sun/star/table/CellAddress.hpp>
18#include <com/sun/star/table/CellRangeAddress.hpp>
19
20#include <cppunit/TestAssert.h>
21
27template <>
28inline std::string CPPUNIT_NS::assertion_traits<css::awt::Point>::toString(const css::awt::Point& x)
29{
30 OStringStream ost;
31 ost << "Point: " << x.X << "." << x.Y << " (coordinate: X.Y)";
32 return ost.str();
33}
34
40template <>
41inline std::string CPPUNIT_NS::assertion_traits<css::awt::Size>::toString(const css::awt::Size& x)
42{
43 OStringStream ost;
44 ost << "Size: " << x.Width << " x " << x.Height << " (Width x Height)";
45 return ost.str();
46}
47
53template <>
54inline std::string
55CPPUNIT_NS::assertion_traits<css::table::CellAddress>::toString(const css::table::CellAddress& x)
56{
57 OStringStream ost;
58 ost << "Sheet: " << x.Sheet << " Column: " << x.Column << " Row: " << x.Row;
59 return ost.str();
60}
61
67template <>
68inline std::string CPPUNIT_NS::assertion_traits<css::table::CellRangeAddress>::toString(
69 const css::table::CellRangeAddress& x)
70{
71 OStringStream ost;
72 ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " StartRow: " << x.StartRow
73 << " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
74 return ost.str();
75}
76
77#endif // INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
float x