1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #ifndef INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
11 #define INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
13 #include <rtl/ustring.hxx>
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>
20 #include <cppunit/TestAssert.h>
22 /** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Point.
24 * This specialization from @c struct @c assertion_traits<> helps to compare
25 * @see com::sun::star::awt::Point.
28 inline std::string
CPPUNIT_NS::assertion_traits
<css::awt::Point
>::toString(const css::awt::Point
& x
)
31 ost
<< "Point: " << x
.X
<< "." << x
.Y
<< " (coordinate: X.Y)";
35 /** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Size.
37 * This specialization from @c struct @c assertion_traits<> helps to compare
38 * @see com::sun::star::awt::Size.
41 inline std::string
CPPUNIT_NS::assertion_traits
<css::awt::Size
>::toString(const css::awt::Size
& x
)
44 ost
<< "Size: " << x
.Width
<< " x " << x
.Height
<< " (Width x Height)";
48 /** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star::table::CellAddress.
50 * This specialization from @c struct @c assertion_traits<> helps to compare
51 * @see com::sun::star::table::CellAddress.
55 CPPUNIT_NS::assertion_traits
<css::table::CellAddress
>::toString(const css::table::CellAddress
& x
)
58 ost
<< "Sheet: " << x
.Sheet
<< " Column: " << x
.Column
<< " Row: " << x
.Row
;
62 /** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star::table::CellRangeAddress.
64 * This specialization from @c struct @c assertion_traits<> helps to compare
65 * @see com::sun::star::table::CellRangeAddress.
68 inline std::string
CPPUNIT_NS::assertion_traits
<css::table::CellRangeAddress
>::toString(
69 const css::table::CellRangeAddress
& x
)
72 ost
<< "Sheet: " << x
.Sheet
<< " StartColumn: " << x
.StartColumn
<< " StartRow: " << x
.StartRow
73 << " EndColumn: " << x
.EndColumn
<< " EndRow: " << x
.EndRow
;
77 #endif // INCLUDED_TEST_CPPUNITASSERTHELPER_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */