OLD | NEW |
1 #include <gtest/gtest.h> | 1 #include <gtest/gtest.h> |
2 | 2 |
3 #include "../database.h" | 3 #include "../database.h" |
4 #include "../property.h" | 4 #include "../property.h" |
5 | 5 |
6 TEST(Property_Test, null) | 6 TEST(Property_Test, null) |
7 { | 7 { |
8 /* | 8 /* |
9 * This is an extract of manual test code originally run from AbpCloseIe DLL e
ntry point. | 9 * This is an extract of manual test code originally run from AbpCloseIe DLL e
ntry point. |
10 * This code relies on an MSI database opened for installation, which we don't
need to access properties. | 10 * This code relies on an MSI database opened for installation, which we don't
need to access properties. |
11 * We can instead use an offline session, with the database opened outside Win
dows Installer. | 11 * We can instead use an offline session, with the database opened outside Win
dows Installer. |
12 * That session class, though, isn't written yet. | 12 * That session class, though, isn't written yet. |
13 */ | 13 */ |
14 /* | 14 /* |
15 * DISABLED. Refactor into proper tests. | 15 * DISABLED. Refactor into proper tests. |
16 */ | 16 */ |
17 if (false) | 17 if (false) |
18 { | 18 { |
19 // This variable was the argument to the entry point. | 19 // This variable was the argument to the entry point. |
20 MSIHANDLE session_handle = 0; | 20 MSIHANDLE sessionHandle = 0; |
21 | 21 |
22 // The code in the body. | 22 // The code in the body. |
23 ImmediateSession session(session_handle, "AbpCloseIe"); | 23 ImmediateSession session(sessionHandle, "AbpCloseIe"); |
24 session.Log(L"Have session object"); | 24 session.Log(L"Have session object"); |
25 InstallationDatabase db(session); | 25 InstallationDatabase db(session); |
26 session.Log(L"Have database object"); | 26 session.Log(L"Have database object"); |
27 | 27 |
28 // Test: ensure that a property is present with its expected value. Exercise
s the conversion operator to String. | 28 // Test: ensure that a property is present with its expected value. Exercise
s the conversion operator to String. |
29 session.Log(L"VersionMsi = " + Property(session, L"VersionMsi")); | 29 session.Log(L"VersionMsi = " + Property(session, L"VersionMsi")); |
30 | 30 |
31 // Test: create a property dynamically from within the CA. Not sure if this
can be done offline. | 31 // Test: create a property dynamically from within the CA. Not sure if this
can be done offline. |
32 Property tv(session, L"TESTVARIABLE"); | 32 Property tv(session, L"TESTVARIABLE"); |
33 session.Log(L"TESTVARIABLE = " + tv); | 33 session.Log(L"TESTVARIABLE = " + tv); |
34 | 34 |
35 // Test: assign a new value to a property. | 35 // Test: assign a new value to a property. |
36 session.Log(L"Setting TESTVARIABLE to 'testvalue'"); | 36 session.Log(L"Setting TESTVARIABLE to 'testvalue'"); |
37 tv = L"testvalue"; | 37 tv = L"testvalue"; |
38 session.Log(L"TESTVARIABLE = " + tv); | 38 session.Log(L"TESTVARIABLE = " + tv); |
39 } | 39 } |
40 } | 40 } |
OLD | NEW |