2019-06-25 23:37:13 +02:00
|
|
|
#include "test/framework/catch.hpp"
|
|
|
|
#include "src/shellmatta_utils.c"
|
|
|
|
#include <string.h>
|
|
|
|
|
2019-12-05 22:55:28 +01:00
|
|
|
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
|
2019-06-25 23:37:13 +02:00
|
|
|
{
|
|
|
|
return SHELLMATTA_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE( "shellmatta_clearInput normal call" ) {
|
|
|
|
|
|
|
|
shellmatta_instance_t inst;
|
|
|
|
char buffer[20];
|
|
|
|
|
|
|
|
inst.buffer = buffer;
|
|
|
|
inst.bufferSize = 20;
|
|
|
|
inst.cursor = 10;
|
|
|
|
inst.inputCount = 10;
|
|
|
|
|
|
|
|
inst.write = writeFct;
|
|
|
|
|
|
|
|
utils_clearInput(&inst);
|
|
|
|
|
|
|
|
CHECK( inst.cursor == 0);
|
|
|
|
REQUIRE( inst.inputCount == 0);
|
|
|
|
}
|