2019-06-25 23:37:13 +02:00
|
|
|
#include "test/framework/catch.hpp"
|
|
|
|
#include "src/shellmatta_utils.c"
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
shellmatta_retCode_t writeFct(const char* data, uint32_t length)
|
|
|
|
{
|
|
|
|
return SHELLMATTA_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE( "shellmatta_insertChars normal call" ) {
|
|
|
|
|
|
|
|
shellmatta_instance_t inst;
|
|
|
|
char buffer[20];
|
|
|
|
|
|
|
|
inst.buffer = buffer;
|
|
|
|
inst.bufferSize = 20;
|
|
|
|
inst.cursor = 8;
|
|
|
|
inst.inputCount = 10;
|
|
|
|
|
|
|
|
inst.write = writeFct;
|
|
|
|
|
|
|
|
utils_insertChars(&inst, "blksdflsd kfjlk", 4);
|
|
|
|
|
2019-06-27 22:56:03 +02:00
|
|
|
CHECK( inst.cursor == 12);
|
|
|
|
REQUIRE( inst.inputCount == 14);
|
2019-06-25 23:37:13 +02:00
|
|
|
}
|
|
|
|
|