SolidSyslog coverage report
Current view: top level - Platform/VxWorks64/Source - SolidSyslogVxWorks64Hostname.c (source / functions) Coverage Total Hit
Test: SolidSyslog Lines: 100.0 % 5 5
Test Date: 2026-11-12 23:14:35 Functions: 100.0 % 1 1
Branches: 100.0 % 2 2

             Branch data     Line data    Source code
       1                 :             : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
       2                 :             :  * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
       3                 :             :  */
       4                 :             : 
       5                 :             : #include "SolidSyslogVxWorks64Hostname.h"
       6                 :             : 
       7                 :             : #include "vxWorks.h"
       8                 :             : 
       9                 :             : #include "hostLib.h"
      10                 :             : 
      11                 :             : #include "SolidSyslogHeaderField.h"
      12                 :             : 
      13                 :          47 : void SolidSyslogVxWorks64_GetHostname(struct SolidSyslogHeaderField* field, void* context)
      14                 :             : {
      15                 :             :     char hostname[MAXHOSTNAMELEN + 1];
      16                 :             : 
      17                 :             :     (void) context;
      18                 :             : 
      19         [ +  + ]:          47 :     if (gethostname(hostname, (int) sizeof(hostname)) == OK)
      20                 :             :     {
      21                 :          46 :         hostname[MAXHOSTNAMELEN] = '\0';
      22                 :          46 :         SolidSyslogHeaderField_PrintUsAscii(field, hostname, sizeof(hostname));
      23                 :             :     }
      24                 :          47 : }
        

Generated by: LCOV version 2.0-1