| OLD | NEW |
| 1 #include <gtest/gtest.h> | 1 #include <gtest/gtest.h> |
| 2 #include "../process.h" | 2 #include "../process.h" |
| 3 #include <functional> | 3 #include <functional> |
| 4 | 4 |
| 5 // Turn off warnings for string copies | 5 // Turn off warnings for string copies |
| 6 #pragma warning( disable : 4996 ) | 6 #pragma warning( disable : 4996 ) |
| 7 | 7 |
| 8 //------------------------------------------------------- | 8 //------------------------------------------------------- |
| 9 // Comparison objects | 9 // Comparison objects |
| 10 //------------------------------------------------------- | 10 //------------------------------------------------------- |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 //------------------------------------------------------- | 163 //------------------------------------------------------- |
| 164 // Single-snapshot version of initializers | 164 // Single-snapshot version of initializers |
| 165 //------------------------------------------------------- | 165 //------------------------------------------------------- |
| 166 /** | 166 /** |
| 167 * Single-snapshot version of initialize_process_list, for testing. | 167 * Single-snapshot version of initialize_process_list, for testing. |
| 168 */ | 168 */ |
| 169 template< class T, class Admittance, class Extractor > | 169 template< class T, class Admittance, class Extractor > |
| 170 void initialize_process_list( std::vector< T > & v, Admittance admit = Admittanc
e(), Extractor extract = Extractor() ) | 170 void initialize_process_list( std::vector< T > & v, Admittance admit = Admittanc
e(), Extractor extract = Extractor() ) |
| 171 { | 171 { |
| 172 initialize_process_list( v, Process_Snapshot(), admit, extract ) ; | 172 initialize_process_list( v, ProcessSnapshot(), admit, extract ) ; |
| 173 } | 173 } |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * Single-snapshot version of initialize_process_set, for testing. | 176 * Single-snapshot version of initialize_process_set, for testing. |
| 177 */ | 177 */ |
| 178 template< class T, class Admittance, class Extractor > | 178 template< class T, class Admittance, class Extractor > |
| 179 void initialize_process_set( std::set< T > & s, Admittance admit = Admittance(),
Extractor extract = Extractor() ) | 179 void initialize_process_set( std::set< T > & s, Admittance admit = Admittance(),
Extractor extract = Extractor() ) |
| 180 { | 180 { |
| 181 initialize_process_set( s, Process_Snapshot(), admit, extract ) ; | 181 initialize_process_set( s, ProcessSnapshot(), admit, extract ) ; |
| 182 } | 182 } |
| 183 | 183 |
| 184 //------------------------------------------------------- | 184 //------------------------------------------------------- |
| 185 // TESTS with snapshots | 185 // TESTS with snapshots |
| 186 //------------------------------------------------------- | 186 //------------------------------------------------------- |
| 187 /** | 187 /** |
| 188 * Construction test ensures that we don't throw and that at least one process s
hows up. | 188 * Construction test ensures that we don't throw and that at least one process s
hows up. |
| 189 */ | 189 */ |
| 190 TEST( Process_List_Test, construct_vector ) | 190 TEST( Process_List_Test, construct_vector ) |
| 191 { | 191 { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 TEST( pid_set, find_our_process_in_set_not_immersive ) | 286 TEST( pid_set, find_our_process_in_set_not_immersive ) |
| 287 { | 287 { |
| 288 std::set< DWORD > s ; | 288 std::set< DWORD > s ; |
| 289 initialize_process_set( s, find_in_set_not_immersive, copy_PID() ) ; | 289 initialize_process_set( s, find_in_set_not_immersive, copy_PID() ) ; |
| 290 size_t size( s.size() ) ; | 290 size_t size( s.size() ) ; |
| 291 EXPECT_EQ( size, 1u ); | 291 EXPECT_EQ( size, 1u ); |
| 292 ASSERT_GE( size, 1u ); | 292 ASSERT_GE( size, 1u ); |
| 293 } | 293 } |
| OLD | NEW |