• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IJHack / QtPass / 23674153894

28 Mar 2026 01:15AM UTC coverage: 18.352% (-0.2%) from 18.572%
23674153894

push

github

web-flow
fix: improve test assertions (QCOMPARE, simplify bools, fix tautologies) (#800)

* fix: address AI findings in util tests

- normalizeFolderPath: add full path comparison for Windows backslash test
- regexPatterns: rename m1 to urlWithTrailingTextMatch, m3 to urlWithFragmentMatch
- Fix tautology in simpletransaction tests
- Fix transaction tests: just call methods, no assertions needed
- Replace all QVERIFY(x == value) with	Qcompare(x, value)
- Simplify boolean checks: QVERIFY(x == true) → QVERIFY(x)

* chore: add || test pattern to qtpass-testing skill

920 of 5013 relevant lines covered (18.35%)

7.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.89
/src/simpletransaction.cpp
1
// SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2
// SPDX-License-Identifier: GPL-3.0-or-later
3
#include "simpletransaction.h"
4
#include <utility>
5

6
#ifdef QT_DEBUG
7
#include "debughelper.h"
8
#endif
9

10
using Enums::INVALID;
11
using Enums::PROCESS;
12

13
/**
14
 * @brief simpleTransaction::transactionStart
15
 */
16
void simpleTransaction::transactionStart() {
×
17
#ifdef QT_DEBUG
18
  dbg() << "START" << transactionDepth;
19
#endif
20
  transactionDepth++;
×
21
}
×
22

23
/**
24
 * @brief simpleTransaction::transactionAdd
25
 * @param id
26
 */
27
void simpleTransaction::transactionAdd(PROCESS id) {
3✔
28
#ifdef QT_DEBUG
29
  dbg() << "ADD" << transactionDepth << id;
30
#endif
31
  if (transactionDepth > 0) {
3✔
32
    lastInTransaction = id;
×
33
  } else {
34
    transactionQueue.emplace(id, id);
35
  }
36
}
3✔
37

38
/**
39
 * @brief simpleTransaction::transactionEnd
40
 * @param pid
41
 */
42
void simpleTransaction::transactionEnd(PROCESS pid) {
×
43
#ifdef QT_DEBUG
44
  dbg() << "END" << transactionDepth;
45
#endif
46
  if (transactionDepth > 0) {
×
47
    transactionDepth--;
×
48
    if (transactionDepth == 0 && lastInTransaction != INVALID) {
×
49
      transactionQueue.emplace(lastInTransaction, pid);
×
50
      lastInTransaction = INVALID;
×
51
    }
52
  }
53
}
×
54

55
/**
56
 * @brief simpleTransaction::transactionIsOver
57
 * @param id
58
 * @return
59
 */
60
auto simpleTransaction::transactionIsOver(PROCESS id) -> PROCESS {
2✔
61
#ifdef QT_DEBUG
62
  dbg() << "OVER" << transactionDepth << id;
63
#endif
64
  if (!transactionQueue.empty() && id == transactionQueue.front().first) {
2✔
65
    PROCESS ret = transactionQueue.front().second;
1✔
66
    transactionQueue.pop();
67
    return ret;
1✔
68
  }
69
  return INVALID;
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc