LCOV - code coverage report
Current view: top level - libs/mem/tests/src - test_libmem_0034.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 17 17
Test Date: 2026-07-12 01:01:34 Functions: 100.0 % 1 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : #include "test_libmem_all.h"
       2                 :             : 
       3                 :             : /**
       4                 :             :  * @brief Check NULL sources and zero-sized bounded or fixed-string inputs are no-ops
       5                 :             :  *
       6                 :             :  * @return Return describing success or failure
       7                 :             :  */
       8                 :           1 : Return test_libmem_0034(void)
       9                 :             : {
      10                 :           1 :         INITTEST;
      11                 :             : 
      12                 :             :         static const char base_text[] = "base";
      13                 :           1 :         m_create(char,string_buffer);
      14                 :           1 :         ASSERT(SUCCESS == m_to_string(string_buffer));
      15                 :             : 
      16                 :           1 :         const char bounded_suffix[] = {'-','b','\0','x'};
      17                 :           1 :         const char literal_suffix[] = {'-','l','i','t','\0'};
      18                 :             : 
      19                 :           1 :         ASSERT(SUCCESS == m_copy_fixed_string(string_buffer,sizeof(base_text),base_text));
      20                 :           1 :         ASSERT(SUCCESS == m_concat_string(string_buffer,NULL));
      21                 :           1 :         ASSERT(0 == strcmp(m_text(string_buffer),"base"));
      22                 :           1 :         ASSERT(SUCCESS == m_concat_string(string_buffer,sizeof(bounded_suffix),NULL));
      23                 :           1 :         ASSERT(0 == strcmp(m_text(string_buffer),"base"));
      24                 :           1 :         ASSERT(SUCCESS == mem_core_string(SOURCE_FIXED_STRING | TRANSFER_APPEND,string_buffer,sizeof(literal_suffix),NULL));
      25                 :           1 :         ASSERT(0 == strcmp(m_text(string_buffer),"base"));
      26                 :           1 :         ASSERT(SUCCESS == mem_core_string(SOURCE_UNBOUNDED_STRING | TRANSFER_APPEND,string_buffer,sizeof(literal_suffix),NULL));
      27                 :           1 :         ASSERT(0 == strcmp(m_text(string_buffer),"base"));
      28                 :           1 :         call(m_del(string_buffer));
      29                 :             : 
      30                 :           1 :         RETURN_STATUS;
      31                 :             : }
        

Generated by: LCOV version 2.0-1