aria2/test/MockExtensionMessageFactory.h
Tatsuhiro Tsujikawa 3505201f33 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten SharedHandle. Now copy constructor taking raw pointer 
has
	keyword explicit and SharedHandle's default constructor 
initializes
	its internal obj to null, old implementation initializes it 
using
	obj's default constructor.
	To assign null, write SharedHandle<T> x(...); x.reset();
	TODO: test/SharedHandleTest.cc needs more tests.
	* src/SharedHandle.h
2008-04-20 00:50:22 +00:00

24 lines
605 B
C++

#ifndef _D_MOCK_EXTENSION_MESSAGE_FACTORY_H_
#define _D_MOCK_EXTENSION_MESSAGE_FACTORY_H_
#include "ExtensionMessageFactory.h"
#include "MockExtensionMessage.h"
namespace aria2 {
class MockExtensionMessageFactory:public ExtensionMessageFactory {
public:
virtual ~MockExtensionMessageFactory() {}
virtual SharedHandle<ExtensionMessage> createMessage(const unsigned char* data,
size_t length)
{
return SharedHandle<ExtensionMessage>
(new MockExtensionMessage("a2_mock", *data, data+1, length-1));
}
};
} // namespace aria2
#endif // _D_MOCK_EXTENSION_MESSAGE_FACTORY_H_