CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalencoder_test.cpp File Reference
#include <QtWidgets/QApplication>
#include <cansignalencoder.h>
#include "log.h"
#include <QCanBusFrame>
#include <QJsonDocument>
#include <QSignalSpy>
#include <bcastmsgs.h>
#include <cansignaldata.h>
#include <catch.hpp>
#include <fakeit.hpp>
Include dependency graph for cansignalencoder_test.cpp:

Macros

#define CATCH_CONFIG_RUNNER
 

Functions

 Q_DECLARE_METATYPE (QCanBusFrame)
 
 TEST_CASE ("Stubbed methods", "[cansignalencoder]")
 
 TEST_CASE ("setConfig - qobj", "[cansignalencoder]")
 
 TEST_CASE ("setConfig - json", "[cansignalencoder]")
 
 TEST_CASE ("getConfig", "[cansignalencoder]")
 
 TEST_CASE ("getQConfig", "[cansignalencoder]")
 
 TEST_CASE ("configChanged", "[cansignalencoder]")
 
 TEST_CASE ("getSupportedProperties", "[cansignalencoder]")
 
 TEST_CASE ("send preconfigured", "[cansignalencoder]")
 
 TEST_CASE ("recive signals", "[cansignalencoder]")
 
 TEST_CASE ("factor 0", "[cansignalencoder]")
 
 TEST_CASE ("Signal too big", "[cansignalencoder]")
 
 TEST_CASE ("reset init value", "[cansignalencoder]")
 
 TEST_CASE ("UnsignedSignals_LE", "[cansignalencoder]")
 
 TEST_CASE ("SignedSignals_LE", "[cansignalencoder]")
 
 TEST_CASE ("UnsignedSignals_BE", "[cansignalencoder]")
 
 TEST_CASE ("SignedSignals_BE", "[cansignalencoder]")
 
int main (int argc, char *argv[])
 

Variables

std::shared_ptr< spdlog::logger > kDefaultLogger
 
QString testJson
 
QString testJson2
 

Macro Definition Documentation

◆ CATCH_CONFIG_RUNNER

#define CATCH_CONFIG_RUNNER

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ Q_DECLARE_METATYPE()

Q_DECLARE_METATYPE ( QCanBusFrame  )

◆ TEST_CASE() [1/16]

TEST_CASE ( "configChanged"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [2/16]

TEST_CASE ( "factor 0"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [3/16]

TEST_CASE ( "getConfig"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [4/16]

TEST_CASE ( "getQConfig"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [5/16]

TEST_CASE ( "getSupportedProperties"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [6/16]

TEST_CASE ( "recive signals"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [7/16]

TEST_CASE ( "reset init value"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [8/16]

TEST_CASE ( "send preconfigured"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [9/16]

TEST_CASE ( "setConfig - json"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [10/16]

TEST_CASE ( "setConfig - qobj"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [11/16]

TEST_CASE ( "Signal too big"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [12/16]

TEST_CASE ( "SignedSignals_BE"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [13/16]

TEST_CASE ( "SignedSignals_LE"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [14/16]

TEST_CASE ( "Stubbed methods"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [15/16]

TEST_CASE ( "UnsignedSignals_BE"  ,
""  [cansignalencoder] 
)

◆ TEST_CASE() [16/16]

TEST_CASE ( "UnsignedSignals_LE"  ,
""  [cansignalencoder] 
)

Variable Documentation

◆ kDefaultLogger

std::shared_ptr<spdlog::logger> kDefaultLogger

◆ testJson

QString testJson
Initial value:
= R"(
{
"msgSettings": [
{
"cycle": "100",
"id": "3",
"initVal": ""
},
{
"cycle": "200",
"id": "e",
"initVal": "1122334455667788"
},
{
"cycle": "500",
"id": "45",
"initVal": "aabbccddeeff0099"
},
{
"cycle": "2000",
"id": "6d",
"initVal": "AABBCCDD"
}
],
"name": "CanSignalData"
}
)"

◆ testJson2

QString testJson2
Initial value:
= R"(
{
"msgSettings": [
{
"cycle": "500",
"id": "6d",
"initVal": "AABBCCDD"
}
],
"name": "CanSignalData"
}
)"