Skip to content

Commit

Permalink
Use RUNTIME_VERIFY_OR_DEBUG_ASSERT
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jan 9, 2025
1 parent b5f3fe7 commit ea2d1fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/engine/effects/engineeffectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void EngineEffectsManager::onCallbackStart() {
}
}

VERIFY_OR_DEBUG_ASSERT(chainExists) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(chainExists) {
response.success = false;
response.status = EffectsResponse::NO_SUCH_CHAIN;
break;
Expand Down
10 changes: 5 additions & 5 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ QVariant BaseTrackTableModel::roleValue(
double durationInSeconds;
if (rawValue.canConvert<mixxx::Duration>()) {
const auto duration = rawValue.value<mixxx::Duration>();
VERIFY_OR_DEBUG_ASSERT(duration >= mixxx::Duration::empty()) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(duration >= mixxx::Duration::empty()) {
return QVariant();
}
durationInSeconds = duration.toDoubleSeconds();
Expand All @@ -756,7 +756,7 @@ QVariant BaseTrackTableModel::roleValue(
}
bool ok;
durationInSeconds = rawValue.toDouble(&ok);
VERIFY_OR_DEBUG_ASSERT(ok && durationInSeconds >= 0) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(ok && durationInSeconds >= 0) {
return QVariant();
}
}
Expand All @@ -773,7 +773,7 @@ QVariant BaseTrackTableModel::roleValue(
}
bool ok;
const auto starCount = rawValue.toInt(&ok);
VERIFY_OR_DEBUG_ASSERT(ok && starCount >= StarRating::kMinStarCount) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(ok && starCount >= StarRating::kMinStarCount) {
return QVariant();
}
return QVariant::fromValue(StarRating(starCount));
Expand All @@ -787,7 +787,7 @@ QVariant BaseTrackTableModel::roleValue(
}
bool ok;
const auto timesPlayed = rawValue.toInt(&ok);
VERIFY_OR_DEBUG_ASSERT(ok && timesPlayed >= 0) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(ok && timesPlayed >= 0) {
return QVariant();
}
return QString::number(timesPlayed);
Expand Down Expand Up @@ -1186,7 +1186,7 @@ void BaseTrackTableModel::slotRefreshCoverRows(
return;
}
const int column = fieldIndex(LIBRARYTABLE_COVERART);
VERIFY_OR_DEBUG_ASSERT(column >= 0) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(column >= 0) {
return;
}
emitDataChangedForMultipleRowsInColumn(rows, column);
Expand Down
2 changes: 1 addition & 1 deletion src/library/proxytrackmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ProxyTrackModel::ProxyTrackModel(QAbstractItemModel* pTrackModel,
m_pTrackModel(dynamic_cast<TrackModel*>(pTrackModel)),
m_currentSearch(""),
m_bHandleSearches(bHandleSearches) {
X_VERIFY_OR_DEBUG_ASSERT(m_pTrackModel && pTrackModel) {
VERIFY_OR_DEBUG_ASSERT(m_pTrackModel) {
return;
}
setSourceModel(pTrackModel);
Expand Down
8 changes: 4 additions & 4 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ void WTrackTableView::loadSelectedTrackToGroup(const QString& group,

QList<TrackId> WTrackTableView::getSelectedTrackIds() const {
TrackModel* pTrackModel = getTrackModel();
VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
qWarning() << "No track model available";
return {};
}
Expand All @@ -1371,7 +1371,7 @@ QList<TrackId> WTrackTableView::getSelectedTrackIds() const {

TrackId WTrackTableView::getCurrentTrackId() const {
TrackModel* pTrackModel = getTrackModel();
VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
qWarning() << "No track model available";
return {};
}
Expand All @@ -1395,7 +1395,7 @@ bool WTrackTableView::isTrackInCurrentView(const TrackId& trackId) {
}
//qDebug() << "WTrackTableView::isTrackInCurrentView" << trackId;
TrackModel* pTrackModel = getTrackModel();
VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
qWarning() << "No track model";
return false;
}
Expand All @@ -1406,7 +1406,7 @@ bool WTrackTableView::isTrackInCurrentView(const TrackId& trackId) {

void WTrackTableView::setSelectedTracks(const QList<TrackId>& trackIds) {
TrackModel* pTrackModel = getTrackModel();
VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
RUNTIME_VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) {
qWarning() << "No track model";
return;
}
Expand Down

0 comments on commit ea2d1fa

Please sign in to comment.