reactos/rostests/rosautotest/auto_array_ptr.h
Colin Finck 10f13abcb5 Big testing system commit
rosautotest
- Rewrite rosautotest in C++
  Should increase maintainability and expandability, since most of the functionality is encapsulated in classes and there exist some abstract classes for further enhancements (i.e. new test types).
  Furthermore, due to the usage of STL strings, we don't need x lines anymore just for building a string out of several small parts.
- The new codebase made it fairly easy to implement a Crash Recovery feature based on a journal.
  If you start rosautotest with the /r option under ReactOS, it will keep a journal about the tests to run and the tests already ran. In case of a crash, it can just continue with the next test in the list then.
- Add some reasonable timeouts to avoid certain hangs in case a test crashes

sysreg2
- Make the necessary changes to sysreg2 to restart the VM in case of such a crash in 3rd stage, but set a maximum number of allowed crashes as well.
  Christoph, please test and review that on the Buildslave :-)
- Prepend all sysreg messages with [SYSREG] through a new function SysregPrintf, so the BuildBot aggregator script of testman can distinguish between debug output and sysreg messages.
- Put all header includes into the central header file "sysreg.h"
- Remove unnecessary libs from the Makefile

testman
- Change the testman Web Interface to show such crashes as CRASH in the Compare and Detail views.

svn path=/trunk/; revision=40147
2009-03-21 01:39:04 +00:00

65 lines
1.4 KiB
C++

/*
* PROJECT: ReactOS Automatic Testing Utility
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Template similar to std::auto_ptr for arrays
* COPYRIGHT: Copyright 2009 Colin Finck <colin@reactos.org>
*/
template<typename Type>
class auto_array_ptr
{
private:
Type* m_Ptr;
public:
typedef Type element_type;
/* Construct an auto_array_ptr from a pointer */
explicit auto_array_ptr(Type* Ptr = 0) throw()
: m_Ptr(Ptr)
{
}
/* Construct an auto_array_ptr from an existing auto_array_ptr */
auto_array_ptr(auto_array_ptr<Type>& Right) throw()
: m_Ptr(Right.release())
{
}
/* Destruct the auto_array_ptr and remove the corresponding array from memory */
~auto_array_ptr() throw()
{
delete[] m_Ptr;
}
/* Get the pointer address */
Type* get() const throw()
{
return m_Ptr;
}
/* Release the pointer */
Type* release() throw()
{
Type* Tmp = m_Ptr;
m_Ptr = 0;
return Tmp;
}
/* Reset to a new pointer */
void reset(Type* Ptr = 0) throw()
{
if(Ptr != m_Ptr)
delete[] m_Ptr;
m_Ptr = Ptr;
}
/* Simulate all the functionality of real arrays by casting the auto_array_ptr to Type* on demand */
operator Type*() const throw()
{
return m_Ptr;
}
};