mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Update QsLog to 2.1 snapshot 46b643d5bcbc
This commit is contained in:
38
third_party/QsLog/unittest/QtTestUtil/TestRegistration.h
vendored
Normal file
38
third_party/QsLog/unittest/QtTestUtil/TestRegistration.h
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Remko Troncon
|
||||
* Licensed under the MIT license.
|
||||
* See COPYING for license details.
|
||||
*/
|
||||
|
||||
#ifndef QtTestUtil_TestRegistration_H
|
||||
#define QtTestUtil_TestRegistration_H
|
||||
|
||||
#include "QtTestUtil/TestRegistry.h"
|
||||
|
||||
namespace QtTestUtil {
|
||||
|
||||
/**
|
||||
* A wrapper class around a test to manage registration and static
|
||||
* creation of an instance of the test class.
|
||||
* This class is used by QTTESTUTIL_REGISTER_TEST(), and you should not
|
||||
* use this class directly.
|
||||
*/
|
||||
template<typename TestClass>
|
||||
class TestRegistration {
|
||||
public:
|
||||
TestRegistration() {
|
||||
test_ = new TestClass();
|
||||
TestRegistry::getInstance()->registerTest(test_);
|
||||
}
|
||||
|
||||
~TestRegistration() {
|
||||
delete test_;
|
||||
}
|
||||
|
||||
private:
|
||||
TestClass* test_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user