diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/test/cppunitasserthelper.hxx | 36 | ||||
-rw-r--r-- | include/test/sheet/sheetcell.hxx | 34 |
2 files changed, 70 insertions, 0 deletions
diff --git a/include/test/cppunitasserthelper.hxx b/include/test/cppunitasserthelper.hxx index 4f4f920dd9fc..b6703e255ce0 100644 --- a/include/test/cppunitasserthelper.hxx +++ b/include/test/cppunitasserthelper.hxx @@ -12,6 +12,8 @@ #include <rtl/ustring.hxx> +#include <com/sun/star/awt/Point.hpp> +#include <com/sun/star/awt/Size.hpp> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> @@ -19,6 +21,40 @@ CPPUNIT_NS_BEGIN +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Point. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::awt::Point. + */ +template <> struct assertion_traits<css::awt::Point> +{ + static bool equal(const css::awt::Point& x, const css::awt::Point& y) { return x == y; } + + static std::string toString(const css::awt::Point& x) + { + OStringStream ost; + ost << "Point: " << x.X << "." << x.Y << " (coordinate: X.Y)"; + return ost.str(); + } +}; + +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Size. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::awt::Size. + */ +template <> struct assertion_traits<css::awt::Size> +{ + static bool equal(const css::awt::Size& x, const css::awt::Size& y) { return x == y; } + + static std::string toString(const css::awt::Size& x) + { + OStringStream ost; + ost << "Size: " << x.Width << " x " << x.Height << " (Width x Height)"; + return ost.str(); + } +}; + /** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star::table::CellAddress. * * This specialization from @c struct @c assertion_traits<> helps to compare diff --git a/include/test/sheet/sheetcell.hxx b/include/test/sheet/sheetcell.hxx new file mode 100644 index 000000000000..a5d35cee1a05 --- /dev/null +++ b/include/test/sheet/sheetcell.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETCELL_HXX +#define INCLUDED_TEST_SHEET_SHEETCELL_HXX + +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/uno/Reference.hxx> + +#include <test/testdllapi.hxx> + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetCell +{ +public: + virtual css::uno::Reference<css::uno::XInterface> init() = 0; + + void testSheetCellProperties(); + +protected: + ~SheetCell() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |