File: ut_dsgapplication.cpp

package info (click to toggle)
dtkcore 5.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,728 kB
  • sloc: cpp: 22,021; ansic: 183; python: 68; xml: 58; makefile: 27; sh: 15
file content (27 lines) | stat: -rw-r--r-- 699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#include <gtest/gtest.h>
#include <QCoreApplication>
#include "dsgapplication.h"

DCORE_USE_NAMESPACE

TEST(ut_DSGApplication, id)
{
    if (!qgetenv("DSG_APP_ID").isEmpty()) {
        EXPECT_EQ(DSGApplication::id(), qgetenv("DSG_APP_ID"));
    }

    EXPECT_EQ(DSGApplication::id(), QCoreApplication::applicationName());

//    qputenv("DTK_DISABLED_FALLBACK_APPID", "1");
//    // Q_ASSERT id not empty...
//    EXPECT_EQ(DSGApplication::id(), "");
}

TEST(ut_DSGApplication, getId)
{
    ASSERT_EQ(DSGApplication::getId(QCoreApplication::applicationPid()), QByteArray());
}