@@ -20,9 +20,9 @@ void TestLoadOptionParsing::testParseTestBootData()
20
20
QVERIFY (loadOption.name () == QString (test_boot_name));
21
21
QVERIFY (loadOption.path () == QString (test_boot_path));
22
22
QVERIFY (loadOption.devicePathList ().size () == 2 );
23
- auto devicePathList = loadOption. devicePathList ();
24
- for ( int i = 0 ; i < devicePathList. size (); i++) {
25
- QSharedPointer<QEFIDevicePath> &dp = devicePathList[i];
23
+
24
+ const auto &devicePathList = loadOption. devicePathList ();
25
+ for ( const auto &dp : devicePathList) {
26
26
if (dp->type () == QEFIDevicePathType::DP_Media &&
27
27
dp->subType () == QEFIDevicePathMediaSubType::MEDIA_HD) {
28
28
QEFIDevicePathMediaHD *dpMediaHD =
@@ -46,9 +46,8 @@ void TestLoadOptionParsing::testParseTestBootData2()
46
46
QVERIFY (loadOption.name () == QString (test_boot_name2));
47
47
QVERIFY (loadOption.path () == QString (test_boot_path2));
48
48
QVERIFY (loadOption.devicePathList ().size () == 2 );
49
- auto devicePathList = loadOption.devicePathList ();
50
- for (int i = 0 ; i < devicePathList.size (); i++) {
51
- QSharedPointer<QEFIDevicePath> &dp = devicePathList[i];
49
+ const auto &devicePathList = loadOption.devicePathList ();
50
+ for (const auto &dp : devicePathList) {
52
51
if (dp->type () == QEFIDevicePathType::DP_Media &&
53
52
dp->subType () == QEFIDevicePathMediaSubType::MEDIA_HD) {
54
53
QEFIDevicePathMediaHD *dpMediaHD =
@@ -75,4 +74,4 @@ void TestLoadOptionParsing::testParseEmptyData()
75
74
76
75
QTEST_MAIN (TestLoadOptionParsing)
77
76
78
- #include " test_load_option_parsing.moc"
77
+ #include " test_load_option_parsing.moc"
0 commit comments