#include "include/CommandDecoderTest.h" #include "CommandDecoder.h" QList CommandDecoderTest::handiResult() { QList 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 c1 = comTest.decodeStrintg(5, ptr_array); auto c2 = handiResult(); //QVERIFY(c1 == c2); QCOMPARE(c1, c2); //QCOMPARE(c, c1); }