New QTC_CHECK warning replacing QTC_ASSERT(x, /**/)

Warn if the condition fails, but otherwise don't change the execution
flow.

Change-Id: Id7b14c745109b66960add967b2a4ef8d31e1a546
Reviewed-on: http://codereview.qt.nokia.com/2389
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Kai Koehne
2011-07-29 12:00:11 +02:00
parent c031d4564e
commit 1757228278
40 changed files with 86 additions and 83 deletions
@@ -125,7 +125,7 @@ QString ClassNameValidatingLineEdit::createClassName(const QString &name)
// Remove spaces and convert the adjacent characters to uppercase // Remove spaces and convert the adjacent characters to uppercase
QString className = name; QString className = name;
QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2); QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2);
QTC_ASSERT(spaceMatcher.isValid(), /**/); QTC_CHECK(spaceMatcher.isValid());
int pos; int pos;
while ((pos = spaceMatcher.indexIn(className)) != -1) { while ((pos = spaceMatcher.indexIn(className)) != -1) {
className.replace(pos, spaceMatcher.matchedLength(), className.replace(pos, spaceMatcher.matchedLength(),
+3
View File
@@ -44,5 +44,8 @@
#define QTC_ASSERT(cond, action) \ #define QTC_ASSERT(cond, action) \
if(cond){}else{qDebug()<<"ASSERTION " #cond " FAILED AT " __FILE__ ":" QTC_ASSERT_STRINGIFY(__LINE__);action;} if(cond){}else{qDebug()<<"ASSERTION " #cond " FAILED AT " __FILE__ ":" QTC_ASSERT_STRINGIFY(__LINE__);action;}
#define QTC_CHECK(cond) \
if(cond){}else{qDebug()<<"ASSERTION " #cond " FAILED AT " __FILE__ ":" QTC_ASSERT_STRINGIFY(__LINE__);}
#endif // QTC_ASSERT_H #endif // QTC_ASSERT_H
+4 -4
View File
@@ -602,7 +602,7 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
foreach (QAction *action, m_actions) foreach (QAction *action, m_actions)
if (m_toolFromAction.value(action) == tool && m_modeFromAction[action] == mode) if (m_toolFromAction.value(action) == tool && m_modeFromAction[action] == mode)
return action; return action;
QTC_ASSERT(false, /**/); QTC_CHECK(false);
return 0; return 0;
} }
@@ -666,9 +666,9 @@ void AnalyzerManagerPrivate::selectTool(IAnalyzerTool *tool, StartMode mode)
if (!m_defaultSettings.contains(tool)) { if (!m_defaultSettings.contains(tool)) {
QWidget *widget = tool->createWidgets(); QWidget *widget = tool->createWidgets();
QTC_ASSERT(widget, /**/); QTC_CHECK(widget);
m_defaultSettings.insert(tool, m_mainWindow->saveSettings()); m_defaultSettings.insert(tool, m_mainWindow->saveSettings());
QTC_ASSERT(!m_controlsWidgetFromTool.contains(tool), /**/); QTC_CHECK(!m_controlsWidgetFromTool.contains(tool));
m_controlsWidgetFromTool[tool] = widget; m_controlsWidgetFromTool[tool] = widget;
m_controlsStackWidget->addWidget(widget); m_controlsStackWidget->addWidget(widget);
} }
@@ -677,7 +677,7 @@ void AnalyzerManagerPrivate::selectTool(IAnalyzerTool *tool, StartMode mode)
loadToolSettings(tool); loadToolSettings(tool);
QTC_ASSERT(m_controlsWidgetFromTool.contains(tool), /**/); QTC_CHECK(m_controlsWidgetFromTool.contains(tool));
m_controlsStackWidget->setCurrentWidget(m_controlsWidgetFromTool.value(tool)); m_controlsStackWidget->setCurrentWidget(m_controlsWidgetFromTool.value(tool));
m_toolBox->setCurrentIndex(actionIndex); m_toolBox->setCurrentIndex(actionIndex);
+1 -1
View File
@@ -565,7 +565,7 @@ MimeTypeData::MimeTypeData()
// "*.log[1-9]" // "*.log[1-9]"
: suffixPattern(QLatin1String("^\\*\\.[\\w+]+$")) : suffixPattern(QLatin1String("^\\*\\.[\\w+]+$"))
{ {
QTC_ASSERT(suffixPattern.isValid(), /**/); QTC_CHECK(suffixPattern.isValid());
} }
void MimeTypeData::clear() void MimeTypeData::clear()
@@ -165,7 +165,7 @@ static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine)
if (fileDialog.exec() == QDialog::Rejected) if (fileDialog.exec() == QDialog::Rejected)
return QScriptValue(engine, QScriptValue::NullValue); return QScriptValue(engine, QScriptValue::NullValue);
const QStringList rc = fileDialog.selectedFiles(); const QStringList rc = fileDialog.selectedFiles();
QTC_ASSERT(!rc.empty(), /**/); QTC_CHECK(!rc.empty());
return TFileMode == QFileDialog::ExistingFiles ? return TFileMode == QFileDialog::ExistingFiles ?
engine->toScriptValue(rc) : engine->toScriptValue(rc.front()); engine->toScriptValue(rc) : engine->toScriptValue(rc.front());
} }
+1 -1
View File
@@ -102,7 +102,7 @@ VersionDialog::VersionDialog(QWidget *parent)
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
QTC_ASSERT(closeButton, /**/); QTC_CHECK(closeButton);
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole)); buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
+1 -1
View File
@@ -232,7 +232,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
<< "\n#define " << guard << '\n'; << "\n#define " << guard << '\n';
const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+")); const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
QTC_ASSERT(qtClassExpr.isValid(), /**/); QTC_CHECK(qtClassExpr.isValid());
// Determine parent QObject type for Qt types. Provide base // Determine parent QObject type for Qt types. Provide base
// class in case the user did not specify one. // class in case the user did not specify one.
QString parentQObjectClass; QString parentQObjectClass;
+1 -1
View File
@@ -127,7 +127,7 @@ cvs diff -d -u -r1.1 -r1.2:
VCSBase::DiffHighlighter *CVSEditor::createDiffHighlighter() const VCSBase::DiffHighlighter *CVSEditor::createDiffHighlighter() const
{ {
const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*1\\.[\\d\\.]+$")); const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*1\\.[\\d\\.]+$"));
QTC_ASSERT(filePattern.isValid(), /**/); QTC_CHECK(filePattern.isValid());
return new VCSBase::DiffHighlighter(filePattern); return new VCSBase::DiffHighlighter(filePattern);
} }
+1 -1
View File
@@ -634,7 +634,7 @@ CVSSubmitEditor *CVSPlugin::openCVSSubmitEditor(const QString &fileName)
Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::CVSCOMMITEDITOR_ID), Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::CVSCOMMITEDITOR_ID),
Core::EditorManager::ModeSwitch); Core::EditorManager::ModeSwitch);
CVSSubmitEditor *submitEditor = qobject_cast<CVSSubmitEditor*>(editor); CVSSubmitEditor *submitEditor = qobject_cast<CVSSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/); QTC_CHECK(submitEditor);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction); submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCommitFiles(QStringList))); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCommitFiles(QStringList)));
+1 -1
View File
@@ -461,7 +461,7 @@ QModelIndex BreakHandler::createIndex(int row, int column, quint32 id) const
QModelIndex BreakHandler::createIndex(int row, int column, void *ptr) const QModelIndex BreakHandler::createIndex(int row, int column, void *ptr) const
{ {
QTC_ASSERT(false, /**/); // This function is not used. QTC_CHECK(false); // This function is not used.
return QAbstractItemModel::createIndex(row, column, ptr); return QAbstractItemModel::createIndex(row, column, ptr);
} }
+10 -10
View File
@@ -743,7 +743,7 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to)
void DebuggerEngine::setupSlaveEngine() void DebuggerEngine::setupSlaveEngine()
{ {
QTC_ASSERT(state() == DebuggerNotReady, /**/); QTC_CHECK(state() == DebuggerNotReady);
d->queueSetupEngine(); d->queueSetupEngine();
} }
@@ -776,7 +776,7 @@ void DebuggerEngine::notifyEngineSetupOk()
void DebuggerEngine::setupSlaveInferior() void DebuggerEngine::setupSlaveInferior()
{ {
QTC_ASSERT(state() == EngineSetupOk, /**/); QTC_CHECK(state() == EngineSetupOk);
d->queueSetupInferior(); d->queueSetupInferior();
} }
@@ -809,7 +809,7 @@ void DebuggerEngine::notifyInferiorSetupOk()
void DebuggerEngine::runSlaveEngine() void DebuggerEngine::runSlaveEngine()
{ {
QTC_ASSERT(isSlaveEngine(), return); QTC_ASSERT(isSlaveEngine(), return);
QTC_ASSERT(state() == InferiorSetupOk, /**/); QTC_CHECK(state() == InferiorSetupOk);
d->queueRunEngine(); d->queueRunEngine();
} }
@@ -980,7 +980,7 @@ void DebuggerEngine::notifyInferiorIll()
void DebuggerEngine::shutdownSlaveEngine() void DebuggerEngine::shutdownSlaveEngine()
{ {
QTC_ASSERT(isAllowedTransition(state(),EngineShutdownRequested), /**/); QTC_CHECK(isAllowedTransition(state(),EngineShutdownRequested));
setState(EngineShutdownRequested); setState(EngineShutdownRequested);
shutdownEngine(); shutdownEngine();
} }
@@ -1329,7 +1329,7 @@ void DebuggerEngine::updateAll()
#if 0 #if 0
// FIXME: Remove explicit use of BreakpointData // FIXME: Remove explicit use of BreakpointData
if (!bp->engine && acceptsBreakpoint(id)) { if (!bp->engine && acceptsBreakpoint(id)) {
QTC_ASSERT(state == BreakpointNew, /**/); QTC_CHECK(state == BreakpointNew);
// Take ownership of the breakpoint. // Take ownership of the breakpoint.
bp->engine = this; bp->engine = this;
} }
@@ -1355,7 +1355,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
switch (handler->state(id)) { switch (handler->state(id)) {
case BreakpointNew: case BreakpointNew:
// Should not happen once claimed. // Should not happen once claimed.
QTC_ASSERT(false, /**/); QTC_CHECK(false);
continue; continue;
case BreakpointInsertRequested: case BreakpointInsertRequested:
done = false; done = false;
@@ -1381,7 +1381,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
continue; continue;
case BreakpointDead: case BreakpointDead:
// Should not only be visible inside BreakpointHandler. // Should not only be visible inside BreakpointHandler.
QTC_ASSERT(false, /**/); QTC_CHECK(false);
continue; continue;
} }
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << id << state()); QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << id << state());
@@ -1395,21 +1395,21 @@ void DebuggerEngine::insertBreakpoint(BreakpointModelId id)
{ {
BreakpointState state = breakHandler()->state(id); BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointInsertRequested, qDebug() << id << this << state); QTC_ASSERT(state == BreakpointInsertRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
void DebuggerEngine::removeBreakpoint(BreakpointModelId id) void DebuggerEngine::removeBreakpoint(BreakpointModelId id)
{ {
BreakpointState state = breakHandler()->state(id); BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointRemoveRequested, qDebug() << id << this << state); QTC_ASSERT(state == BreakpointRemoveRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
void DebuggerEngine::changeBreakpoint(BreakpointModelId id) void DebuggerEngine::changeBreakpoint(BreakpointModelId id)
{ {
BreakpointState state = breakHandler()->state(id); BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointChangeRequested, qDebug() << id << this << state); QTC_ASSERT(state == BreakpointChangeRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
void DebuggerEngine::selectThread(int) void DebuggerEngine::selectThread(int)
+3 -3
View File
@@ -1113,7 +1113,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
qRegisterMetaType<ContextData>("ContextData"); qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerStartParameters>("DebuggerStartParameters"); qRegisterMetaType<DebuggerStartParameters>("DebuggerStartParameters");
QTC_ASSERT(!theDebuggerCore, /**/); QTC_CHECK(!theDebuggerCore);
theDebuggerCore = this; theDebuggerCore = this;
m_plugin = plugin; m_plugin = plugin;
@@ -1350,7 +1350,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
Target *target = project->activeTarget(); Target *target = project->activeTarget();
QTC_ASSERT(target, return); QTC_ASSERT(target, return);
activeRc = target->activeRunConfiguration(); activeRc = target->activeRunConfiguration();
QTC_ASSERT(activeRc, /**/); QTC_CHECK(activeRc);
} }
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) { for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit. // Run controls might be deleted during exit.
@@ -3148,7 +3148,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
SLOT(onCurrentProjectChanged(ProjectExplorer::Project*))); SLOT(onCurrentProjectChanged(ProjectExplorer::Project*)));
QTC_ASSERT(m_coreSettings, /**/); QTC_CHECK(m_coreSettings);
m_globalDebuggerOptions->fromSettings(m_coreSettings); m_globalDebuggerOptions->fromSettings(m_coreSettings);
m_watchersWindow->setVisible(false); m_watchersWindow->setVisible(false);
m_returnWindow->setVisible(false); m_returnWindow->setVisible(false);
+1 -1
View File
@@ -345,7 +345,7 @@ bool DebuggerRunControl::isRunning() const
DebuggerEngine *DebuggerRunControl::engine() DebuggerEngine *DebuggerRunControl::engine()
{ {
QTC_ASSERT(d->m_engine, /**/); QTC_CHECK(d->m_engine);
return d->m_engine; return d->m_engine;
} }
@@ -107,7 +107,7 @@ void AbstractPlainGdbAdapter::handleExecRun(const GdbResponse &response)
m_engine->postCommand("target record"); m_engine->postCommand("target record");
} else { } else {
QString msg = fromLocalEncoding(response.data.findChild("msg").data()); QString msg = fromLocalEncoding(response.data.findChild("msg").data());
//QTC_ASSERT(status() == InferiorRunOk, /**/); //QTC_CHECK(status() == InferiorRunOk);
//interruptInferior(); //interruptInferior();
showMessage(msg); showMessage(msg);
m_engine->notifyEngineRunFailed(); m_engine->notifyEngineRunFailed();
@@ -55,7 +55,7 @@
#endif #endif
#define PRECONDITION QTC_ASSERT(!hasPython(), /**/) #define PRECONDITION QTC_CHECK(!hasPython())
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback) #define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
@@ -543,7 +543,7 @@ void DumperHelper::evaluationParameters(const WatchData &data,
// iname="local.ob.slots.2" // ".deleteLater()"? // iname="local.ob.slots.2" // ".deleteLater()"?
const int pos = data.iname.lastIndexOf('.'); const int pos = data.iname.lastIndexOf('.');
const QByteArray slotNumber = data.iname.mid(pos + 1); const QByteArray slotNumber = data.iname.mid(pos + 1);
QTC_ASSERT(slotNumber.toInt() != -1, /**/); QTC_CHECK(slotNumber.toInt() != -1);
extraArgs[0] = slotNumber; extraArgs[0] = slotNumber;
} }
break; break;
@@ -1111,7 +1111,7 @@ void GdbEngine::tryLoadDebuggingHelpersClassic()
// Do not use STRINGIFY for RTLD_NOW as we really want to expand that to a number. // Do not use STRINGIFY for RTLD_NOW as we really want to expand that to a number.
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// We are using Python on Windows and Symbian. // We are using Python on Windows and Symbian.
QTC_ASSERT(false, /**/); QTC_CHECK(false);
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
//postCommand("sharedlibrary libc"); // for malloc //postCommand("sharedlibrary libc"); // for malloc
//postCommand("sharedlibrary libdl"); // for dlopen //postCommand("sharedlibrary libdl"); // for dlopen
+2 -2
View File
@@ -417,7 +417,7 @@ void CodaGdbAdapter::logMessage(const QString &msg, int channel)
void CodaGdbAdapter::handleGdbConnection() void CodaGdbAdapter::handleGdbConnection()
{ {
logMessage("HANDLING GDB CONNECTION"); logMessage("HANDLING GDB CONNECTION");
QTC_ASSERT(m_gdbConnection == 0, /**/); QTC_CHECK(m_gdbConnection == 0);
m_gdbConnection = m_gdbServer->nextPendingConnection(); m_gdbConnection = m_gdbServer->nextPendingConnection();
QTC_ASSERT(m_gdbConnection, return); QTC_ASSERT(m_gdbConnection, return);
connect(m_gdbConnection, SIGNAL(disconnected()), connect(m_gdbConnection, SIGNAL(disconnected()),
@@ -1550,7 +1550,7 @@ void CodaGdbAdapter::tryAnswerGdbMemoryRequest(bool buffered)
} }
} }
// Happens when chunks are not combined // Happens when chunks are not combined
QTC_ASSERT(false, /**/); QTC_CHECK(false);
showMessage("CHUNKS NOT COMBINED"); showMessage("CHUNKS NOT COMBINED");
# ifdef MEMORY_DEBUG # ifdef MEMORY_DEBUG
qDebug() << "CHUNKS NOT COMBINED"; qDebug() << "CHUNKS NOT COMBINED";
+1 -1
View File
@@ -239,7 +239,7 @@ void CoreGdbAdapter::runEngine()
void CoreGdbAdapter::interruptInferior() void CoreGdbAdapter::interruptInferior()
{ {
// A core never runs, so this cannot be called. // A core never runs, so this cannot be called.
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
void CoreGdbAdapter::shutdownInferior() void CoreGdbAdapter::shutdownInferior()
+20 -20
View File
@@ -1023,7 +1023,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
showMessage(_("APPLYING WORKAROUND #5")); showMessage(_("APPLYING WORKAROUND #5"));
showMessageBox(QMessageBox::Critical, showMessageBox(QMessageBox::Critical,
tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg)); tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg));
QTC_ASSERT(state() == InferiorRunOk, /**/); QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
notifyEngineIll(); notifyEngineIll();
} else { } else {
@@ -1147,7 +1147,7 @@ bool GdbEngine::acceptsDebuggerCommands() const
void GdbEngine::executeDebuggerCommand(const QString &command) void GdbEngine::executeDebuggerCommand(const QString &command)
{ {
QTC_ASSERT(acceptsDebuggerCommands(), /**/); QTC_CHECK(acceptsDebuggerCommands());
m_gdbAdapter->write(command.toLatin1() + "\r\n"); m_gdbAdapter->write(command.toLatin1() + "\r\n");
} }
@@ -1337,7 +1337,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
notifyInferiorStopOk(); notifyInferiorStopOk();
flushQueuedCommands(); flushQueuedCommands();
if (state() == InferiorStopOk) { if (state() == InferiorStopOk) {
QTC_ASSERT(m_commandsDoneCallback == 0, /**/); QTC_CHECK(m_commandsDoneCallback == 0);
m_commandsDoneCallback = &GdbEngine::autoContinueInferior; m_commandsDoneCallback = &GdbEngine::autoContinueInferior;
} else { } else {
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state()) QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state())
@@ -1969,7 +1969,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter()
void GdbEngine::setupEngine() void GdbEngine::setupEngine()
{ {
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized, /**/); QTC_CHECK(m_debuggingHelperState == DebuggingHelperUninitialized);
if (m_gdbAdapter->dumperHandling() != AbstractGdbAdapter::DumperNotAvailable) { if (m_gdbAdapter->dumperHandling() != AbstractGdbAdapter::DumperNotAvailable) {
connect(debuggerCore()->action(UseDebuggingHelpers), connect(debuggerCore()->action(UseDebuggingHelpers),
@@ -1977,7 +1977,7 @@ void GdbEngine::setupEngine()
SLOT(setUseDebuggingHelpers(QVariant))); SLOT(setUseDebuggingHelpers(QVariant)));
} }
QTC_ASSERT(state() == EngineSetupRequested, /**/); QTC_CHECK(state() == EngineSetupRequested);
m_gdbAdapter->startAdapter(); m_gdbAdapter->startAdapter();
} }
@@ -2068,7 +2068,7 @@ void GdbEngine::handleExecuteStep(const GdbResponse &response)
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should // Step was finishing too quick, and a '*stopped' messages should
// have preceded it, so just ignore this result. // have preceded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/); QTC_CHECK(state() == InferiorStopOk);
return; return;
} }
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state()); QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
@@ -2138,7 +2138,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response)
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should // Step was finishing too quick, and a '*stopped' messages should
// have preceded it, so just ignore this result. // have preceded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/); QTC_CHECK(state() == InferiorStopOk);
return; return;
} }
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state()); QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
@@ -2447,7 +2447,7 @@ void GdbEngine::handleWatchInsert(const GdbResponse &response)
if (exp.startsWith('*')) if (exp.startsWith('*'))
br.address = exp.mid(1).toULongLong(0, 0); br.address = exp.mid(1).toULongLong(0, 0);
handler->setResponse(id, br); handler->setResponse(id, br);
QTC_ASSERT(!handler->needsChange(id), /**/); QTC_CHECK(!handler->needsChange(id));
handler->notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
} else if (ba.startsWith("Hardware watchpoint ") } else if (ba.startsWith("Hardware watchpoint ")
|| ba.startsWith("Watchpoint ")) { || ba.startsWith("Watchpoint ")) {
@@ -2459,7 +2459,7 @@ void GdbEngine::handleWatchInsert(const GdbResponse &response)
if (address.startsWith('*')) if (address.startsWith('*'))
br.address = address.mid(1).toULongLong(0, 0); br.address = address.mid(1).toULongLong(0, 0);
handler->setResponse(id, br); handler->setResponse(id, br);
QTC_ASSERT(!handler->needsChange(id), /**/); QTC_CHECK(!handler->needsChange(id));
handler->notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
} else { } else {
showMessage(_("CANNOT PARSE WATCHPOINT FROM " + ba)); showMessage(_("CANNOT PARSE WATCHPOINT FROM " + ba));
@@ -2658,7 +2658,7 @@ void GdbEngine::handleBreakList(const GdbMi &table)
void GdbEngine::handleBreakListMultiple(const GdbResponse &response) void GdbEngine::handleBreakListMultiple(const GdbResponse &response)
{ {
QTC_ASSERT(response.resultClass == GdbResultDone, /**/) QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>(); const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
const QString str = QString::fromLocal8Bit(response.consoleStreamOutput); const QString str = QString::fromLocal8Bit(response.consoleStreamOutput);
extractDataFromInfoBreak(str, id); extractDataFromInfoBreak(str, id);
@@ -2666,7 +2666,7 @@ void GdbEngine::handleBreakListMultiple(const GdbResponse &response)
void GdbEngine::handleBreakDisable(const GdbResponse &response) void GdbEngine::handleBreakDisable(const GdbResponse &response)
{ {
QTC_ASSERT(response.resultClass == GdbResultDone, /**/) QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>(); const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
// This should only be the requested state. // This should only be the requested state.
@@ -2679,7 +2679,7 @@ void GdbEngine::handleBreakDisable(const GdbResponse &response)
void GdbEngine::handleBreakEnable(const GdbResponse &response) void GdbEngine::handleBreakEnable(const GdbResponse &response)
{ {
QTC_ASSERT(response.resultClass == GdbResultDone, /**/) QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>(); const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
// This should only be the requested state. // This should only be the requested state.
@@ -2692,7 +2692,7 @@ void GdbEngine::handleBreakEnable(const GdbResponse &response)
void GdbEngine::handleBreakThreadSpec(const GdbResponse &response) void GdbEngine::handleBreakThreadSpec(const GdbResponse &response)
{ {
QTC_ASSERT(response.resultClass == GdbResultDone, /**/) QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>(); const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
@@ -2714,7 +2714,7 @@ void GdbEngine::handleBreakIgnore(const GdbResponse &response)
// 29^done // 29^done
// //
// gdb 6.3 does not produce any console output // gdb 6.3 does not produce any console output
QTC_ASSERT(response.resultClass == GdbResultDone, /**/) QTC_CHECK(response.resultClass == GdbResultDone)
//QString msg = _(response.consoleStreamOutput); //QString msg = _(response.consoleStreamOutput);
BreakpointModelId id = response.cookie.value<BreakpointModelId>(); BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
@@ -2734,7 +2734,7 @@ void GdbEngine::handleBreakIgnore(const GdbResponse &response)
void GdbEngine::handleBreakCondition(const GdbResponse &response) void GdbEngine::handleBreakCondition(const GdbResponse &response)
{ {
// Can happen at invalid condition strings. // Can happen at invalid condition strings.
//QTC_ASSERT(response.resultClass == GdbResultDone, /**/) //QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>(); const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
// We just assume it was successful. Otherwise we had to parse // We just assume it was successful. Otherwise we had to parse
@@ -2923,7 +2923,7 @@ void GdbEngine::insertBreakpoint(BreakpointModelId id)
// Set up fallback in case of pending breakpoints which aren't handled // Set up fallback in case of pending breakpoints which aren't handled
// by the MI interface. // by the MI interface.
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointInsertRequested, /**/); QTC_CHECK(handler->state(id) == BreakpointInsertRequested);
handler->notifyBreakpointInsertProceeding(id); handler->notifyBreakpointInsertProceeding(id);
BreakpointType type = handler->type(id); BreakpointType type = handler->type(id);
QVariant vid = QVariant::fromValue(id); QVariant vid = QVariant::fromValue(id);
@@ -3054,7 +3054,7 @@ void GdbEngine::changeBreakpoint(BreakpointModelId id)
void GdbEngine::removeBreakpoint(BreakpointModelId id) void GdbEngine::removeBreakpoint(BreakpointModelId id)
{ {
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/); QTC_CHECK(handler->state(id) == BreakpointRemoveRequested);
handler->notifyBreakpointRemoveProceeding(id); handler->notifyBreakpointRemoveProceeding(id);
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString()) showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString())
@@ -3298,7 +3298,7 @@ void GdbEngine::reloadSourceFiles()
void GdbEngine::reloadSourceFilesInternal() void GdbEngine::reloadSourceFilesInternal()
{ {
QTC_ASSERT(!m_sourcesListUpdating, /**/); QTC_CHECK(!m_sourcesListUpdating);
m_sourcesListUpdating = true; m_sourcesListUpdating = true;
postCommand("-file-list-exec-source-files", NeedsStop, CB(handleQuerySources)); postCommand("-file-list-exec-source-files", NeedsStop, CB(handleQuerySources));
#if 0 #if 0
@@ -3328,7 +3328,7 @@ void GdbEngine::selectThread(int index)
void GdbEngine::handleStackSelectThread(const GdbResponse &) void GdbEngine::handleStackSelectThread(const GdbResponse &)
{ {
QTC_ASSERT(state() == InferiorUnrunnable || state() == InferiorStopOk, /**/); QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
showStatusMessage(tr("Retrieving data for stack view..."), 3000); showStatusMessage(tr("Retrieving data for stack view..."), 3000);
reloadStack(true); // Will reload registers. reloadStack(true); // Will reload registers.
updateLocals(); updateLocals();
@@ -4871,7 +4871,7 @@ void GdbEngine::handleInferiorPrepared()
if (m_cookieForToken.isEmpty()) { if (m_cookieForToken.isEmpty()) {
finishInferiorSetup(); finishInferiorSetup();
} else { } else {
QTC_ASSERT(m_commandsDoneCallback == 0, /**/); QTC_CHECK(m_commandsDoneCallback == 0);
m_commandsDoneCallback = &GdbEngine::finishInferiorSetup; m_commandsDoneCallback = &GdbEngine::finishInferiorSetup;
} }
} }
+2 -2
View File
@@ -183,7 +183,7 @@ void GdbMi::parseValue(const char *&from, const char *to)
void GdbMi::parseTuple(const char *&from, const char *to) void GdbMi::parseTuple(const char *&from, const char *to)
{ {
//qDebug() << "parseTuple: " << QByteArray(from, to - from); //qDebug() << "parseTuple: " << QByteArray(from, to - from);
QTC_ASSERT(*from == '{', /**/); QTC_CHECK(*from == '{');
++from; ++from;
parseTuple_helper(from, to); parseTuple_helper(from, to);
} }
@@ -211,7 +211,7 @@ void GdbMi::parseTuple_helper(const char *&from, const char *to)
void GdbMi::parseList(const char *&from, const char *to) void GdbMi::parseList(const char *&from, const char *to)
{ {
//qDebug() << "parseList: " << QByteArray(from, to - from); //qDebug() << "parseList: " << QByteArray(from, to - from);
QTC_ASSERT(*from == '[', /**/); QTC_CHECK(*from == '[');
++from; ++from;
m_type = List; m_type = List;
skipCommas(from, to); skipCommas(from, to);
+2 -2
View File
@@ -44,7 +44,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#define PRECONDITION QTC_ASSERT(hasPython(), /**/) #define PRECONDITION QTC_CHECK(hasPython())
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback) #define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
@@ -200,7 +200,7 @@ void GdbEngine::updateAllPython()
{ {
PRECONDITION; PRECONDITION;
//PENDING_DEBUG("UPDATING ALL\n"); //PENDING_DEBUG("UPDATING ALL\n");
QTC_ASSERT(state() == InferiorUnrunnable || state() == InferiorStopOk, /**/); QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
reloadModulesInternal(); reloadModulesInternal();
postCommand("-stack-list-frames", CB(handleStackListFrames), postCommand("-stack-list-frames", CB(handleStackListFrames),
QVariant::fromValue<StackCookie>(StackCookie(false, true))); QVariant::fromValue<StackCookie>(StackCookie(false, true)));
+1 -1
View File
@@ -59,7 +59,7 @@ MemoryRange::MemoryRange(uint f, uint t)
bool MemoryRange::intersects(const MemoryRange &other) const bool MemoryRange::intersects(const MemoryRange &other) const
{ {
Q_UNUSED(other); Q_UNUSED(other);
QTC_ASSERT(false, /**/); QTC_CHECK(false);
return false; // FIXME return false; // FIXME
} }
+1 -1
View File
@@ -93,7 +93,7 @@ namespace { const int DataRange = 1024 * 1024; }
MemoryAgent::MemoryAgent(DebuggerEngine *engine) MemoryAgent::MemoryAgent(DebuggerEngine *engine)
: QObject(engine), m_engine(engine) : QObject(engine), m_engine(engine)
{ {
QTC_ASSERT(engine, /**/); QTC_CHECK(engine);
connect(engine, SIGNAL(stateChanged(Debugger::DebuggerState)), connect(engine, SIGNAL(stateChanged(Debugger::DebuggerState)),
this, SLOT(engineStateChanged(Debugger::DebuggerState))); this, SLOT(engineStateChanged(Debugger::DebuggerState)));
connect(engine, SIGNAL(stackFrameCompleted()), this, connect(engine, SIGNAL(stackFrameCompleted()), this,
+2 -2
View File
@@ -338,7 +338,7 @@ bool PdbEngine::acceptsBreakpoint(BreakpointModelId id) const
void PdbEngine::insertBreakpoint(BreakpointModelId id) void PdbEngine::insertBreakpoint(BreakpointModelId id)
{ {
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointInsertRequested, /**/); QTC_CHECK(handler->state(id) == BreakpointInsertRequested);
handler->notifyBreakpointInsertProceeding(id); handler->notifyBreakpointInsertProceeding(id);
QByteArray loc; QByteArray loc;
@@ -374,7 +374,7 @@ void PdbEngine::handleBreakInsert(const PdbResponse &response)
void PdbEngine::removeBreakpoint(BreakpointModelId id) void PdbEngine::removeBreakpoint(BreakpointModelId id)
{ {
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/); QTC_CHECK(handler->state(id) == BreakpointRemoveRequested);
handler->notifyBreakpointRemoveProceeding(id); handler->notifyBreakpointRemoveProceeding(id);
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString()) showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString())
+1 -1
View File
@@ -317,7 +317,7 @@ void QmlCppEngine::detachDebugger()
void QmlCppEngine::executeStep() void QmlCppEngine::executeStep()
{ {
if (d->m_activeEngine == d->m_qmlEngine) { if (d->m_activeEngine == d->m_qmlEngine) {
QTC_ASSERT(d->m_cppEngine->state() == InferiorRunOk, /**/); QTC_CHECK(d->m_cppEngine->state() == InferiorRunOk);
if (d->m_cppEngine->setupQmlStep(true)) if (d->m_cppEngine->setupQmlStep(true))
return; // Wait for callback to readyToExecuteQmlStep() return; // Wait for callback to readyToExecuteQmlStep()
} else { } else {
+1 -1
View File
@@ -883,7 +883,7 @@ void QmlEngine::messageReceived(const QByteArray &message)
foreach (BreakpointModelId id, handler->engineBreakpointIds(this)) { foreach (BreakpointModelId id, handler->engineBreakpointIds(this)) {
QString processedFilename = handler->fileName(id); QString processedFilename = handler->fileName(id);
if (processedFilename == file && handler->lineNumber(id) == line) { if (processedFilename == file && handler->lineNumber(id) == line) {
QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/); QTC_CHECK(handler->state(id) == BreakpointInserted);
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
br.fileName = file; br.fileName = file;
br.lineNumber = line; br.lineNumber = line;
+1 -1
View File
@@ -246,7 +246,7 @@ void ScriptEngine::setupEngine()
showMessage(_("STARTING SCRIPT DEBUGGER"), LogMisc); showMessage(_("STARTING SCRIPT DEBUGGER"), LogMisc);
if (m_scriptEngine.isNull()) if (m_scriptEngine.isNull())
m_scriptEngine = Core::ICore::instance()->scriptManager()->scriptEngine(); m_scriptEngine = Core::ICore::instance()->scriptManager()->scriptEngine();
QTC_ASSERT(!m_scriptAgent, /**/); QTC_CHECK(!m_scriptAgent);
m_scriptAgent.reset(new ScriptAgent(this, m_scriptEngine.data())); m_scriptAgent.reset(new ScriptAgent(this, m_scriptEngine.data()));
m_scriptEngine->setAgent(m_scriptAgent.data()); m_scriptEngine->setAgent(m_scriptAgent.data());
//m_scriptEngine->setAgent(new ScriptAgent(this, m_scriptEngine.data())); //m_scriptEngine->setAgent(new ScriptAgent(this, m_scriptEngine.data()));
+2 -2
View File
@@ -812,7 +812,7 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
case LocalsExpandedRole: case LocalsExpandedRole:
if (value.toBool()) { if (value.toBool()) {
// Should already have been triggered by fetchMore() // Should already have been triggered by fetchMore()
//QTC_ASSERT(m_handler->m_expandedINames.contains(data.iname), /**/); //QTC_CHECK(m_handler->m_expandedINames.contains(data.iname));
m_handler->m_expandedINames.insert(data.iname); m_handler->m_expandedINames.insert(data.iname);
} else { } else {
m_handler->m_expandedINames.remove(data.iname); m_handler->m_expandedINames.remove(data.iname);
@@ -1550,7 +1550,7 @@ WatchModel *WatchHandler::model(WatchType type) const
case WatchersWatch: return m_watchers; case WatchersWatch: return m_watchers;
case TooltipsWatch: return m_tooltips; case TooltipsWatch: return m_tooltips;
} }
QTC_ASSERT(false, /**/); QTC_CHECK(false);
return 0; return 0;
} }
+4 -4
View File
@@ -1234,7 +1234,7 @@ void FakeVimHandler::Private::exportSelection()
} else if (m_visualMode == VisualCharMode) { } else if (m_visualMode == VisualCharMode) {
/* Nothing */ /* Nothing */
} else { } else {
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
} else { } else {
setAnchorAndPosition(pos, pos); setAnchorAndPosition(pos, pos);
@@ -1644,7 +1644,7 @@ void FakeVimHandler::Private::updateMiniBuffer()
if (!msg.isEmpty() && m_mode != CommandMode) if (!msg.isEmpty() && m_mode != CommandMode)
msg += QChar(10073); // '|'; // FIXME: Use a real "cursor" msg += QChar(10073); // '|'; // FIXME: Use a real "cursor"
} else { } else {
QTC_ASSERT(m_mode == CommandMode && m_subsubmode != SearchSubSubMode, /**/); QTC_CHECK(m_mode == CommandMode && m_subsubmode != SearchSubSubMode);
msg = "-- COMMAND --"; msg = "-- COMMAND --";
} }
@@ -3368,7 +3368,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd)
showBlackMessage(QString()); showBlackMessage(QString());
SavedAction *act = theFakeVimSettings()->item(cmd.args); SavedAction *act = theFakeVimSettings()->item(cmd.args);
QTC_ASSERT(!cmd.args.isEmpty(), /**/); // Handled by plugin. QTC_CHECK(!cmd.args.isEmpty()); // Handled by plugin.
if (act && act->value().type() == QVariant::Bool) { if (act && act->value().type() == QVariant::Bool) {
// Boolean config to be switched on. // Boolean config to be switched on.
bool oldValue = act->value().toBool(); bool oldValue = act->value().toBool();
@@ -4255,7 +4255,7 @@ void FakeVimHandler::Private::scrollToLine(int line)
QScrollBar *scrollBar = EDITOR(verticalScrollBar()); QScrollBar *scrollBar = EDITOR(verticalScrollBar());
//qDebug() << "SCROLL: " << scrollBar->value() << line; //qDebug() << "SCROLL: " << scrollBar->value() << line;
scrollBar->setValue(line); scrollBar->setValue(line);
//QTC_ASSERT(firstVisibleLine() == line, /**/); //QTC_CHECK(firstVisibleLine() == line);
} }
int FakeVimHandler::Private::firstVisibleLine() const int FakeVimHandler::Private::firstVisibleLine() const
@@ -625,7 +625,7 @@ void GenericProjectFile::rename(const QString &newName)
{ {
// Can't happen // Can't happen
Q_UNUSED(newName); Q_UNUSED(newName);
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
Core::IFile::ReloadBehavior GenericProjectFile::reloadBehavior(ChangeTrigger state, ChangeType type) const Core::IFile::ReloadBehavior GenericProjectFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
+1 -1
View File
@@ -1441,7 +1441,7 @@ GitCommand *GitClient::createCommand(const QString &workingDirectory,
connect(command, SIGNAL(outputData(QByteArray)), outputWindow, SLOT(appendData(QByteArray))); connect(command, SIGNAL(outputData(QByteArray)), outputWindow, SLOT(appendData(QByteArray)));
} }
} else { } else {
QTC_ASSERT(editor, /**/); QTC_CHECK(editor);
connect(command, SIGNAL(outputData(QByteArray)), editor, SLOT(setPlainTextDataFiltered(QByteArray))); connect(command, SIGNAL(outputData(QByteArray)), editor, SLOT(setPlainTextDataFiltered(QByteArray)));
} }
+1 -1
View File
@@ -235,7 +235,7 @@ ExtensionSystem::IPlugin::ShutdownFlag GLSLEditorPlugin::aboutToShutdown()
void GLSLEditorPlugin::initializeEditor(GLSLEditor::GLSLTextEditorWidget *editor) void GLSLEditorPlugin::initializeEditor(GLSLEditor::GLSLTextEditorWidget *editor)
{ {
QTC_ASSERT(m_instance, /**/); QTC_CHECK(m_instance);
m_actionHandler->setupActions(editor); m_actionHandler->setupActions(editor);
+1 -1
View File
@@ -65,7 +65,7 @@ PerforceEditor::PerforceEditor(const VCSBase::VCSBaseEditorParameters *type,
m_changeNumberPattern(QLatin1String("^\\d+$")), m_changeNumberPattern(QLatin1String("^\\d+$")),
m_plugin(PerforcePlugin::perforcePluginInstance()) m_plugin(PerforcePlugin::perforcePluginInstance())
{ {
QTC_ASSERT(m_changeNumberPattern.isValid(), /**/); QTC_CHECK(m_changeNumberPattern.isValid());
setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\"")); setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\""));
if (Perforce::Constants::debug) if (Perforce::Constants::debug)
qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->id; qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->id;
@@ -133,7 +133,7 @@ void PerforceSubmitEditor::updateFields()
lines.removeLast(); // that is the empty line at the end lines.removeLast(); // that is the empty line at the end
const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t")); const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t"));
QTC_ASSERT(leadingTabPattern.isValid(), /**/); QTC_CHECK(leadingTabPattern.isValid());
lines.replaceInStrings(leadingTabPattern, QString()); lines.replaceInStrings(leadingTabPattern, QString());
widget->setDescriptionText(lines.join(newLine)); widget->setDescriptionText(lines.join(newLine));
@@ -258,7 +258,7 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSEditorPlugin::aboutToShutdown()
void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor) void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor)
{ {
QTC_ASSERT(m_instance, /**/); QTC_CHECK(m_instance);
m_actionHandler->setupActions(editor); m_actionHandler->setupActions(editor);
@@ -117,7 +117,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) { qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
runner = new RemoteLinuxQmlProfilerRunner(rmConfig, parent); runner = new RemoteLinuxQmlProfilerRunner(rmConfig, parent);
} else { } else {
QTC_ASSERT(false, /**/); QTC_CHECK(false);
} }
return runner; return runner;
} }
@@ -423,7 +423,7 @@ MaemoQemuSettings::OpenGlMode MaemoQemuRuntimeParserV2::openGlTagToEnum(const QS
return MaemoQemuSettings::SoftwareRendering; return MaemoQemuSettings::SoftwareRendering;
if (tag == QLatin1String("autodetect")) if (tag == QLatin1String("autodetect"))
return MaemoQemuSettings::AutoDetect; return MaemoQemuSettings::AutoDetect;
QTC_ASSERT(false, /**/); QTC_CHECK(false);
return MaemoQemuSettings::AutoDetect; return MaemoQemuSettings::AutoDetect;
} }
+1 -1
View File
@@ -113,7 +113,7 @@ QString SubversionEditor::changeUnderCursor(const QTextCursor &c) const
VCSBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const VCSBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const
{ {
const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*|^Index: .*|^==*$")); const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*|^Index: .*|^==*$"));
QTC_ASSERT(filePattern.isValid(), /**/); QTC_CHECK(filePattern.isValid());
return new VCSBase::DiffHighlighter(filePattern); return new VCSBase::DiffHighlighter(filePattern);
} }
+1 -1
View File
@@ -640,7 +640,7 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri
QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_ID), QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_ID),
Core::EditorManager::ModeSwitch); Core::EditorManager::ModeSwitch);
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor); SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/); QTC_CHECK(submitEditor);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction); submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCommitFiles(QStringList))); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCommitFiles(QStringList)));
submitEditor->setCheckScriptWorkingDirectory(m_commitRepository); submitEditor->setCheckScriptWorkingDirectory(m_commitRepository);
+1 -1
View File
@@ -110,7 +110,7 @@ DiffHighlighterPrivate::DiffHighlighterPrivate(const QRegExp &filePattern) :
m_diffOutIndicator(QLatin1Char('-')), m_diffOutIndicator(QLatin1Char('-')),
m_foldingState(StartOfFile) m_foldingState(StartOfFile)
{ {
QTC_ASSERT(filePattern.isValid(), /**/); QTC_CHECK(filePattern.isValid());
} }
DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const
+2 -2
View File
@@ -240,7 +240,7 @@ void JsonValue::parseObject(const char *&from, const char *to)
{ {
JDEBUG("parseObject: " << QByteArray(from, to - from)); JDEBUG("parseObject: " << QByteArray(from, to - from));
#ifdef TODO_USE_CREATOR #ifdef TODO_USE_CREATOR
QTC_ASSERT(*from == '{', /**/); QTC_CHECK(*from == '{');
#endif #endif
++from; ++from;
m_type = Object; m_type = Object;
@@ -263,7 +263,7 @@ void JsonValue::parseArray(const char *&from, const char *to)
{ {
JDEBUG("parseArray: " << QByteArray(from, to - from)); JDEBUG("parseArray: " << QByteArray(from, to - from));
#ifdef TODO_USE_CREATOR #ifdef TODO_USE_CREATOR
QTC_ASSERT(*from == '[', /**/); QTC_CHECK(*from == '[');
#endif #endif
++from; ++from;
m_type = Array; m_type = Array;