File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,21 @@ add_executable(test_parse_boot_name test_parse_boot_name.cc)
8
8
add_executable (test_parse_boot_guid test_parse_boot_guid.cc )
9
9
add_executable (test_parse_boot_path test_parse_boot_path.cc )
10
10
add_executable (test_load_option_parsing test_load_option_parsing.cc )
11
+ add_executable (test_load_option_helpers test_load_option_helpers.cc )
11
12
add_executable (test_parse_boot_optional_data test_parse_boot_optional_data.cc )
12
13
13
14
add_test ("Parse Boot Order Test" test_parse_boot_order )
14
15
add_test ("Parse Boot Name Test" test_parse_boot_name )
15
16
add_test ("Parse Boot GUID Test" test_parse_boot_guid )
16
17
add_test ("Parse Boot Path Test" test_parse_boot_path )
17
18
add_test ("Load Option parsing Test" test_load_option_parsing )
19
+ add_test ("Load Option helpers Test" test_load_option_helpers )
18
20
add_test ("Parse Boot Optional Data Test" test_parse_boot_optional_data )
19
21
20
22
target_link_libraries (test_parse_boot_order ${test_libraries} )
21
23
target_link_libraries (test_parse_boot_name ${test_libraries} )
22
24
target_link_libraries (test_parse_boot_guid ${test_libraries} )
23
25
target_link_libraries (test_parse_boot_path ${test_libraries} )
24
26
target_link_libraries (test_load_option_parsing ${test_libraries} )
27
+ target_link_libraries (test_load_option_helpers ${test_libraries} )
25
28
target_link_libraries (test_parse_boot_optional_data ${test_libraries} )
Original file line number Diff line number Diff line change
1
+ #include < QtTest/QtTest>
2
+
3
+ #include " test_data.h"
4
+ #include " ../qefi.h"
5
+
6
+ class TestLoadOptionHelpers : public QObject
7
+ {
8
+ Q_OBJECT
9
+ private slots:
10
+ void testParseTestBootData ();
11
+ void testParseTestBootData2 ();
12
+ void testParseEmptyData ();
13
+ };
14
+
15
+ void TestLoadOptionHelpers::testParseTestBootData ()
16
+ {
17
+ QByteArray data ((const char *)test_boot_data, TEST_BOOT_DATA_LENGTH);
18
+
19
+ QVERIFY (qefi_loadopt_description_length (data) ==
20
+ 2 * strlen (test_boot_name));
21
+ QVERIFY (qefi_loadopt_dp_list_length (data) == 0x0068 );
22
+ QVERIFY (qefi_loadopt_optional_data_length (data) == 0 );
23
+ }
24
+
25
+ void TestLoadOptionHelpers::testParseTestBootData2 ()
26
+ {
27
+ QByteArray data ((const char *)test_boot_data2, TEST_BOOT_DATA2_LENGTH);
28
+
29
+ QVERIFY (qefi_loadopt_description_length (data) ==
30
+ 2 * strlen (test_boot_name2));
31
+ QVERIFY (qefi_loadopt_dp_list_length (data) == 0x0074 );
32
+ QVERIFY (qefi_loadopt_optional_data_length (data) == 136 );
33
+ }
34
+
35
+ void TestLoadOptionHelpers::testParseEmptyData ()
36
+ {
37
+ QByteArray data;
38
+ QVERIFY (qefi_loadopt_description_length (data) <= 0 );
39
+ QVERIFY (qefi_loadopt_dp_list_length (data) <= 0 );
40
+ QVERIFY (qefi_loadopt_optional_data_length (data) <= 0 );
41
+ }
42
+
43
+ QTEST_MAIN (TestLoadOptionHelpers)
44
+
45
+ #include " test_load_option_helpers.moc"
You can’t perform that action at this time.
0 commit comments