shellmatta/test/unittest/shellmatta_utils/test_utils_clearInput.cpp
prozessorkern 5ff3bfa12e added some integration tests
to test the integrated shellmatta using only the external api
2019-07-28 22:28:54 +02:00

27 lines
520 B
C++

#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_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);
}