123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * Copyright (c) 2019 - 2024 Stefan Strobel <stefan.strobel@shimatta.net>
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- */
- /**
- * @file test_utils_clearInput.c
- * @brief unittest for shellmatta utils_clearInput
- * @author Stefan Strobel <stefan.strobel@shimatta.net>
- */
- #include "test/framework/catch.hpp"
- #include "src/shellmatta_utils.c"
- #include <string.h>
- static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
- {
- (void)data;
- (void)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);
- }
|