mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-07 10:14:41 +00:00
Renamed the test to test_dotherside.cpp
This commit is contained in:
parent
8f188552c2
commit
5c94dd3d70
@ -12,6 +12,6 @@ find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Test REQUIRED)
|
||||
find_package(Qt5Quick REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME} Resources.qrc test_dynamicqobject.cpp main.qml)
|
||||
add_executable(${PROJECT_NAME} Resources.qrc test_dotherside.cpp main.qml)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
||||
target_link_libraries(${PROJECT_NAME} DOtherSideStatic Qt5::Quick Qt5::Widgets Qt5::Test Qt5::Core)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "DOtherSide/DynamicQObject.h"
|
||||
#include "DOtherSide/DynamicQObjectFactory.h"
|
||||
|
||||
|
||||
template<typename Test>
|
||||
bool ExecuteTest(int argc, char* argv[]) {
|
||||
Test test;
|
||||
@ -34,6 +33,7 @@ bool ExecuteGuiTest(int argc, char* argv[]) {
|
||||
class TestQGuiApplication : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testExecution() {
|
||||
bool quit = false;
|
||||
@ -51,6 +51,7 @@ private slots:
|
||||
class TestQApplication : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testExecution() {
|
||||
bool quit = false;
|
||||
@ -68,11 +69,16 @@ private slots:
|
||||
class TestQQmlApplicationEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase() {
|
||||
m_engine = nullptr;
|
||||
}
|
||||
|
||||
void cleanupTestCase() {
|
||||
QVERIFY(m_engine == nullptr);
|
||||
}
|
||||
|
||||
void init() {
|
||||
QVERIFY(m_engine == nullptr);
|
||||
dos_qqmlapplicationengine_create(&m_engine);
|
||||
@ -117,8 +123,37 @@ private:
|
||||
/*
|
||||
* Test QQmlContext
|
||||
*/
|
||||
class TestQQmlContext {
|
||||
class TestQQmlContext : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase() {
|
||||
m_engine = nullptr;
|
||||
m_context = nullptr;
|
||||
}
|
||||
|
||||
void cleanupTestCase() {
|
||||
QVERIFY(m_engine == nullptr);
|
||||
QVERIFY(m_context == nullptr);
|
||||
}
|
||||
|
||||
void init() {
|
||||
dos_qqmlapplicationengine_create(&m_engine);
|
||||
dos_qqmlapplicationengine_context(m_engine, &m_context);
|
||||
QVERIFY(m_engine != nullptr);
|
||||
QVERIFY(m_context != nullptr);
|
||||
}
|
||||
|
||||
void cleanup() {
|
||||
m_context = nullptr;
|
||||
dos_qqmlapplicationengine_delete(m_engine);
|
||||
m_engine = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
void* m_engine;
|
||||
void* m_context;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -166,4 +201,4 @@ int main(int argc, char* argv[])
|
||||
return success ? 0 : 1;
|
||||
}
|
||||
|
||||
#include "test_dynamicqobject.moc"
|
||||
#include "test_dotherside.moc"
|
Loading…
x
Reference in New Issue
Block a user