mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-28 21:05:45 -05:00
[partition] Coding style on tests
This commit is contained in:
parent
b33e54abb9
commit
c7857b7749
1 changed files with 9 additions and 10 deletions
|
@ -26,19 +26,17 @@ QTEST_GUILESS_MAIN( ClearMountsJobTests )
|
||||||
|
|
||||||
|
|
||||||
/* Not exactly public API */
|
/* Not exactly public API */
|
||||||
QStringList
|
QStringList getPartitionsForDevice( const QString& deviceName );
|
||||||
getPartitionsForDevice( const QString& deviceName );
|
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
getPartitionsForDevice_other(const QString& deviceName)
|
getPartitionsForDevice_other( const QString& deviceName )
|
||||||
{
|
{
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.setProgram( "sh" );
|
process.setProgram( "sh" );
|
||||||
process.setArguments( {
|
process.setArguments(
|
||||||
"-c",
|
{ "-c",
|
||||||
QString( "echo $(awk '{print $4}' /proc/partitions | sed -e '/name/d' -e '/^$/d' -e '/[1-9]/!d' | grep %1)" )
|
QString( "echo $(awk '{print $4}' /proc/partitions | sed -e '/name/d' -e '/^$/d' -e '/[1-9]/!d' | grep %1)" )
|
||||||
.arg( deviceName )
|
.arg( deviceName ) } );
|
||||||
} );
|
|
||||||
process.start();
|
process.start();
|
||||||
process.waitForFinished();
|
process.waitForFinished();
|
||||||
|
|
||||||
|
@ -55,10 +53,11 @@ getPartitionsForDevice_other(const QString& deviceName)
|
||||||
|
|
||||||
ClearMountsJobTests::ClearMountsJobTests()
|
ClearMountsJobTests::ClearMountsJobTests()
|
||||||
{
|
{
|
||||||
Logger::setupLogLevel(6);
|
Logger::setupLogLevel( Logger::LOGDEBUG );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearMountsJobTests::testFindPartitions()
|
void
|
||||||
|
ClearMountsJobTests::testFindPartitions()
|
||||||
{
|
{
|
||||||
QStringList partitions = getPartitionsForDevice( "sda" );
|
QStringList partitions = getPartitionsForDevice( "sda" );
|
||||||
QStringList other_part = getPartitionsForDevice_other( "sda" );
|
QStringList other_part = getPartitionsForDevice_other( "sda" );
|
||||||
|
|
Loading…
Add table
Reference in a new issue