aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/unittest/unittest-utility-functions.h
blob: 71f0ea13cb440ca3cfb9e4fad3eda8901ac20d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/hostosinfo.h>
#include <utils/smallstring.h>
#include <utils/temporarydirectory.h>

inline
bool operator==(const QString &first, const char *second)
{
    return first == QString::fromUtf8(second, int(std::strlen(second)));
}

namespace UnitTest {

inline
Utils::PathString temporaryDirPath()
{
    return Utils::PathString::fromQString(Utils::TemporaryDirectory::masterDirectoryPath());
}

} // namespace UnitTest