Torc  0.1
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 {
19  bool exit = false;
20  cmdl->Evaluate(mArgc, mArgv, exit);
21  if (!exit)
22  {
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);
38  }
39  delete cmdl;
40 }
41 
static qint16 Create(TorcCommandLine *CommandLine, bool Init=true)
Torc command line handler.
static void TearDown(void)
int Evaluate(int argc, const char *const *argv, bool &Exit)
Evaluate the command line options.