Add braces around single line statements

* Ran clang-tidy with "readability-braces-around-statements" to find missing braces around statements.
This commit is contained in:
Jonathan White 2020-01-07 22:06:31 -05:00
parent c427000184
commit c663b5d5fc
12 changed files with 98 additions and 54 deletions

View file

@ -30,8 +30,9 @@ void TestCsvParser::initTestCase()
void TestCsvParser::init()
{
file.reset(new QTemporaryFile());
if (not file->open())
if (not file->open()) {
QFAIL("Cannot open file!");
}
parser->setBackslashSyntax(false);
parser->setComment('#');
parser->setFieldSeparator(',');

View file

@ -289,14 +289,16 @@ void TestSymmetricCipher::testTwofish256CbcEncryption()
QCOMPARE(cipher.blockSize(), 16);
for (int j = 0; j < 5000; ++j) {
ctCur = cipher.process(ptNext, &ok);
if (!ok)
if (!ok) {
break;
}
ptNext = ctPrev;
ctPrev = ctCur;
ctCur = cipher.process(ptNext, &ok);
if (!ok)
if (!ok) {
break;
}
ptNext = ctPrev;
ctPrev = ctCur;
}
@ -342,13 +344,15 @@ void TestSymmetricCipher::testTwofish256CbcDecryption()
QCOMPARE(cipher.blockSize(), 16);
for (int j = 0; j < 5000; ++j) {
ptCur = cipher.process(ctNext, &ok);
if (!ok)
if (!ok) {
break;
}
ctNext = ptCur;
ptCur = cipher.process(ctNext, &ok);
if (!ok)
if (!ok) {
break;
}
ctNext = ptCur;
}

View file

@ -84,12 +84,14 @@ void TestYubiKeyChalResp::ykDetected(int slot, bool blocking)
{
Q_UNUSED(blocking);
if (slot > 0)
if (slot > 0) {
m_detected++;
}
/* Key used for later testing */
if (!m_key)
if (!m_key) {
m_key.reset(new YkChallengeResponseKey(slot, blocking));
}
}
void TestYubiKeyChalResp::deinit()