Torc
0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
test
testtorclocalcontext.cpp
Go to the documentation of this file.
1
// Qt
2
#include <QtTest/QtTest>
3
#include <QJsonDocument>
4
5
// Torc
6
#include "
torclocalcontext.h
"
7
#include "
testtorclocalcontext.h
"
8
#include "
torcinputs.h
"
9
#include "
torcoutputs.h
"
10
#include "
torccontrols.h
"
11
#include "
torccompat.h
"
12
13
// std
14
#include <signal.h>
15
16
void
TestTorcLocalContext::testTorcLocalContext(
void
)
17
{
18
TorcCommandLine
*cmdl =
new
TorcCommandLine
(
TorcCommandLine::Database
|
TorcCommandLine::LogFile
|
TorcCommandLine::XSDTest
);
19
bool
exit =
false
;
20
cmdl->
Evaluate
(mArgc, mArgv, exit);
21
if
(!exit)
22
{
23
TorcLocalContext::Create
(cmdl);
24
// give the admin loop time to process - otherwise we try to delete the local context
25
// while it is still being referenced
26
usleep(2000000);
27
28
// actually test something
29
QVERIFY(!TorcInputs::gInputs->GetInputList().isEmpty());
30
QVERIFY(!TorcInputs::gInputs->GetInputTypes().isEmpty());
31
QVERIFY(!TorcOutputs::gOutputs->GetOutputList().isEmpty());
32
QVERIFY(!TorcOutputs::gOutputs->GetOutputTypes().isEmpty());
33
QVERIFY(!TorcControls::gControls->GetControlList().isEmpty());
34
QVERIFY(!TorcControls::gControls->GetControlTypes().isEmpty());
35
36
kill(getpid(), SIGINT);
37
TorcLocalContext::TearDown
();
38
}
39
delete
cmdl;
40
}
41
TorcLocalContext::Create
static qint16 Create(TorcCommandLine *CommandLine, bool Init=true)
Definition:
torclocalcontext.cpp:65
TorcCommandLine
Torc command line handler.
Definition:
torccommandline.h:14
torcoutputs.h
TorcCommandLine::Database
Definition:
torccommandline.h:27
TorcCommandLine::LogFile
Definition:
torccommandline.h:28
torcinputs.h
TorcLocalContext::TearDown
static void TearDown(void)
Definition:
torclocalcontext.cpp:79
testtorclocalcontext.h
torccompat.h
TorcCommandLine::Evaluate
int Evaluate(int argc, const char *const *argv, bool &Exit)
Evaluate the command line options.
Definition:
torccommandline.cpp:186
TorcCommandLine::XSDTest
Definition:
torccommandline.h:29
torccontrols.h
torclocalcontext.h
Generated on Sat Jan 5 2019 21:54:03 for Torc by
1.8.11