Exemple #1
0
void ProcessUnitTests::testOpenCloseByName()
{
    Process p;
    p.Open(L"explorer.exe", PROCESS_QUERY_INFORMATION, FALSE);
    CPPUNIT_ASSERT(p.IsOpen());
    p.Close();
    CPPUNIT_ASSERT(! p.IsOpen());
}
Exemple #2
0
void ProcessUnitTests::testOpenClose()
{
    Process p;
    p.Open(::GetCurrentProcessId(), PROCESS_ALL_ACCESS);
    CPPUNIT_ASSERT(p.IsOpen());
    p.Close();
    CPPUNIT_ASSERT(! p.IsOpen());
    p.Open(::GetCurrentProcessId(), PROCESS_QUERY_INFORMATION);
    CPPUNIT_ASSERT(p.IsOpen());
}
Exemple #3
0
void ProcessUnitTests::testConstructorDestructor()
{
    {
        Process p;
        CPPUNIT_ASSERT(! p.IsOpen());
    }
}