| 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 abp_close_ie DLL
     entry 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 session_handle = 0; | 
| 21 | 21 | 
| 22     // The code in the body. | 22     // The code in the body. | 
| 23     Immediate_Session session( session_handle, "abp_close_ie" ) ; | 23     ImmediateSession session( session_handle, "AbpCloseIe" ) ; | 
| 24     session.log( L"Have session object" ) ; | 24     session.log( L"Have session object" ) ; | 
| 25     Installation_Database 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 | 
|---|