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_UNOTEST_ASSERTION_TRAITS_HXX
11 #define INCLUDED_UNOTEST_ASSERTION_TRAITS_HXX
13 // sal/types.h declares typedefs to signed char (sal_Int8) and unsigned char
14 // (sal_uInt8, sal_Bool), so better specialize CppUnit::assertion_traits for
15 // those two types to treat the toString() value as an integer rather than a
18 #include <sal/config.h>
24 template<> struct assertion_traits
<signed char> {
25 static bool equal(signed char x
, signed char y
) { return x
== y
; }
27 static std::string
toString(signed char x
)
28 { return std::to_string(static_cast<int>(x
)); }
31 template<> struct assertion_traits
<unsigned char> {
32 static bool equal(unsigned char x
, unsigned char y
) { return x
== y
; }
34 static std::string
toString(unsigned char x
)
35 { return std::to_string(static_cast<unsigned int>(x
)); }
42 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */