From 8324d03f0a015e62b6182843b4478226a5197090 Mon Sep 17 00:00:00 2001 From: Louis-Bertrand Varin Date: Sat, 31 Mar 2018 16:01:30 -0400 Subject: Formatting the code. --- tests/TestGlobal.h | 64 +++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 34 deletions(-) (limited to 'tests/TestGlobal.h') diff --git a/tests/TestGlobal.h b/tests/TestGlobal.h index 017fbd5f9..788bd8a13 100644 --- a/tests/TestGlobal.h +++ b/tests/TestGlobal.h @@ -18,52 +18,48 @@ #ifndef KEEPASSXC_TESTGLOBAL_H #define KEEPASSXC_TESTGLOBAL_H -#include "core/Uuid.h" #include "core/Group.h" +#include "core/Uuid.h" -#include #include +#include -namespace QTest { - -template<> -inline char* toString(const Uuid& uuid) -{ - QByteArray ba = "Uuid("; - ba += uuid.toHex().toLatin1().constData(); - ba += ")"; - return qstrdup(ba.constData()); -} - -template<> -inline char* toString(const Group::TriState& triState) +namespace QTest { - QString value; - if (triState == Group::Inherit) { - value = "null"; - } else if (triState == Group::Enable) { - value = "true"; - } else { - value = "false"; + template <> inline char* toString(const Uuid& uuid) + { + QByteArray ba = "Uuid("; + ba += uuid.toHex().toLatin1().constData(); + ba += ")"; + return qstrdup(ba.constData()); } - return qstrdup(value.toLocal8Bit().constData()); -} + template <> inline char* toString(const Group::TriState& triState) + { + QString value; -} // namespace QTest + if (triState == Group::Inherit) { + value = "null"; + } else if (triState == Group::Enable) { + value = "true"; + } else { + value = "false"; + } + return qstrdup(value.toLocal8Bit().constData()); + } -namespace Test { +} // namespace QTest -inline QDateTime datetime(int year, int month, int day, int hour, int min, int second) +namespace Test { - return QDateTime( - QDate(year, month, day), - QTime(hour, min, second), - Qt::UTC); -} -} // namespace Test + inline QDateTime datetime(int year, int month, int day, int hour, int min, int second) + { + return QDateTime(QDate(year, month, day), QTime(hour, min, second), Qt::UTC); + } + +} // namespace Test -#endif //KEEPASSXC_TESTGLOBAL_H +#endif // KEEPASSXC_TESTGLOBAL_H -- cgit v1.2.3