Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/stub_linux/stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#define REPLACE_FAR(t, fn, fn_stub)\
*fn = 0x49;\
*(fn + 1) = 0xbb;\
*(long long *)(fn + 2) = (long long)fn_stub;\
std::memcpy(fn + 2, &fn_stub, sizeof(long long));\
*(fn + 10) = 0x41;\
*(fn + 11) = 0xff;\
*(fn + 12) = 0xe3;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/shottoolwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public slots:
DLabel *m_thicknessLabel;


DLabel *m_effectSubTool;
DLabel *m_effectSubTool = nullptr;
/**
* @brief 当前选中的图形名称
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ TEST_F(ExtCaptureRecorderCovTest, stopRecordingFromRecordingState)
{
access_private_field::ExtCaptureRecorderm_state(*m_rec) = ExtCaptureRecorder::Recording;
EXPECT_NO_FATAL_FAILURE(m_rec->stopRecording());
EXPECT_EQ(m_rec->state(), ExtCaptureRecorder::Stopping);
EXPECT_EQ(m_rec->state(), ExtCaptureRecorder::Stopped);
}

// stopRecording:从 Starting 态执行
TEST_F(ExtCaptureRecorderCovTest, stopRecordingFromStartingState)
{
access_private_field::ExtCaptureRecorderm_state(*m_rec) = ExtCaptureRecorder::Starting;
EXPECT_NO_FATAL_FAILURE(m_rec->stopRecording());
EXPECT_EQ(m_rec->state(), ExtCaptureRecorder::Stopping);
EXPECT_EQ(m_rec->state(), ExtCaptureRecorder::Stopped);
}

// onExtCaptureUnavailable:Recording 态 -> stopRecording + emit error
Expand Down
5 changes: 3 additions & 2 deletions tests/ut_screen_shot_recorder/utils/ut_calculaterect.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once
#include <QDebug>

Check warning on line 6 in tests/ut_screen_shot_recorder/utils/ut_calculaterect.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <cmath>

Check warning on line 7 in tests/ut_screen_shot_recorder/utils/ut_calculaterect.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <cmath> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPointF>

Check warning on line 8 in tests/ut_screen_shot_recorder/utils/ut_calculaterect.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPointF> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <gtest/gtest.h>

Check warning on line 9 in tests/ut_screen_shot_recorder/utils/ut_calculaterect.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <gtest/gtest.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include "../../src/utils/calculaterect.h"

Check warning on line 10 in tests/ut_screen_shot_recorder/utils/ut_calculaterect.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "../../src/utils/calculaterect.h" not found.

using namespace testing;

Expand Down Expand Up @@ -69,7 +70,7 @@
EXPECT_TRUE(pointOnLine(point1, point2, point3));
EXPECT_EQ(5, getDistance(point1, point4));

EXPECT_DOUBLE_EQ(-0.54030230586813977, calculateAngle(point1, point2, point3));
EXPECT_NEAR(-M_PI, calculateAngle(point1, point2, point3), 1e-6);
calculateAngle(QPointF(5, 5), QPointF(5, 5), point1);
calculateAngle(QPointF(15, 25), QPointF(10, 20), QPointF(25, 15));
calculateAngle(QPointF(15, 25), QPointF(10, 20), QPointF(5, 15));
Expand Down
4 changes: 2 additions & 2 deletions tests/ut_screen_shot_recorder/widgets/ut_subtoolwidget_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ TEST_F(SubToolWidgetExtTest, getFuncSubToolXUnknownShapeReturnsMinusOne)
EXPECT_EQ(x, -1);
}

TEST_F(SubToolWidgetExtTest, getFuncSubToolXEmptyStringReturnsZero)
TEST_F(SubToolWidgetExtTest, getFuncSubToolXEmptyStringReturnsMinusOne)
{
QString s;
int x = 999;
EXPECT_NO_FATAL_FAILURE(x = m_w->getFuncSubToolX(s));
EXPECT_EQ(x, 0); // early-return preserves initial x=0 when shape empty
EXPECT_EQ(x, -1); // empty string returns -1 (initial value in source)
}

// ---------------------------------------------------------------------------
Expand Down
Loading