LCOV - code coverage report
Current view: top level - libstb/test - run-stb-container.c (source / functions) Coverage Total Hit
Test: skiboot.info Lines: 100.0 % 9 9
Test Date: 2025-01-24 18:40:10 Functions: 100.0 % 1 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
       2                 :             : /* Copyright 2016 IBM Corp. */
       3                 :             : 
       4                 :             : #include <config.h>
       5                 :             : 
       6                 :             : #include "../container.c"
       7                 :             : 
       8                 :             : #include <assert.h>
       9                 :             : 
      10                 :           1 : int main(void)
      11                 :             : {
      12                 :           1 :         ROM_container_raw *c = malloc(SECURE_BOOT_HEADERS_SIZE);
      13                 :           1 :         assert(stb_is_container(NULL, 0) == false);
      14                 :           1 :         assert(stb_is_container(NULL, SECURE_BOOT_HEADERS_SIZE) == false);
      15                 :           1 :         c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER + 1);
      16                 :           1 :         assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == false);
      17                 :           1 :         c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER);
      18                 :           1 :         assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == true);
      19                 :             : 
      20                 :           1 :         return 0;
      21                 :             : }
        

Generated by: LCOV version 2.0-1