CLI: Use stderr for password prompt

Fixes #3398.

Convert to QTextStream for all CLI IO and greatly improve CLI tests

* Completely overhaul CLI tests to be much more streamlined and easy to read. Removed unnecessary code blocks by using existing functions.

Co-authored-by: Emma Brooks <me@pluvano.com>
This commit is contained in:
Jonathan White
2020-05-11 07:31:29 -04:00
parent 612f8d2e5b
commit 485852c9db
30 changed files with 938 additions and 1407 deletions

View File

@@ -77,8 +77,7 @@ protected:
{
Q_ASSERT(static_cast<unsigned long>(data.size()) < (1ull << (sizeof(SizedQInt) * 8)));
QByteArray fieldIdArr;
fieldIdArr[0] = static_cast<char>(fieldId);
QByteArray fieldIdArr(1, static_cast<char>(fieldId));
CHECK_RETURN_FALSE(writeData(device, fieldIdArr));
CHECK_RETURN_FALSE(writeData(
device, Endian::sizedIntToBytes<SizedQInt>(static_cast<SizedQInt>(data.size()), KeePass2::BYTEORDER)));