You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.1 KiB
55 lines
1.1 KiB
3 years ago
|
#include "include/CommandDecoderTest.h"
|
||
|
|
||
|
#include "CommandDecoder.h"
|
||
|
|
||
|
QList<CommandsType2> CommandDecoderTest::handiResult()
|
||
|
{
|
||
|
QList<CommandsType2> blist;
|
||
|
auto b1 = new CommandsType2();
|
||
|
auto b2 = new CommandsType2();
|
||
|
b1->command = "-node";
|
||
|
b1->value = "3";
|
||
|
blist.append(*b1);
|
||
|
b2->command = "-f";
|
||
|
b2->value = "7";
|
||
|
blist.append(*b2);
|
||
|
|
||
|
return blist;
|
||
|
}
|
||
|
|
||
|
//****************************************************************
|
||
|
CommandDecoderTest::CommandDecoderTest()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
//****************************************************************
|
||
|
CommandDecoderTest::~CommandDecoderTest()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
//****************************************************************
|
||
|
void CommandDecoderTest::testDecoder()
|
||
|
{
|
||
|
CommandDecoder comTest;
|
||
|
|
||
|
char* ptr_array[5];
|
||
|
char array[5][20] = {{0}};
|
||
|
strcpy(array[0], "order");
|
||
|
strcpy(array[1], "-node");
|
||
|
strcpy(array[2], "3");
|
||
|
strcpy(array[3], "-f");
|
||
|
strcpy(array[4], "7");
|
||
|
for(int i = 0; i < 5; i++)
|
||
|
{
|
||
|
ptr_array[i] = array[i];
|
||
|
}
|
||
|
|
||
|
QList<CommandsType2> c1 = comTest.decodeStrintg(5, ptr_array);
|
||
|
auto c2 = handiResult();
|
||
|
|
||
|
//QVERIFY(c1 == c2);
|
||
|
|
||
|
QCOMPARE(c1, c2);
|
||
|
//QCOMPARE(c, c1);
|
||
|
}
|