File: stacktrace_test.cpp

package info (click to toggle)
qtox 1.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,996 kB
  • sloc: cpp: 48,067; xml: 8,560; python: 704; sh: 232; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 605 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
28
29
/* SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright © 2025 The TokTok team.
 */

#include "src/platform/stacktrace.h"

#include <QList>
#include <QString>
#include <QtTest/QtTest>

class TestStacktrace : public QObject
{
    Q_OBJECT

private slots:
    void testEphemeralStacktrace();
};

void TestStacktrace::testEphemeralStacktrace()
{
    QList<QString> trace;
    Stacktrace::process([&trace](const Stacktrace::Frame& frame) {
        qDebug() << frame;
        trace.push_back(QString::fromLatin1(frame.function));
    });
}

QTEST_GUILESS_MAIN(TestStacktrace)
#include "stacktrace_test.moc"