Greenbone Vulnerability Management Libraries: base/hosts_tests.c File Reference

Greenbone Vulnerability Management Libraries 23.1.2

Macros | Functions
hosts_tests.c File Reference
`#include "hosts.c"`
`#include "networking.h"`
`#include <cgreen/cgreen.h>`
`#include <cgreen/mocks.h>`

## Macros
#define | TEN "0123456789"
#define | SIXTY TEN TEN TEN TEN TEN TEN
#define | HUNDRED TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
#define | ASSERT_HOST_EQUALS(hosts, i, string)

## Functions
| Describe (hosts)
| BeforeEach (hosts)
| AfterEach (hosts)
| Ensure (hosts, gvm_hosts_new_never_returns_null)
| Ensure (hosts, gvm_get_host_type_returns_host_type_ipv4)
| Ensure (hosts, gvm_get_host_type_returns_host_type_ipv6)
| Ensure (hosts, gvm_get_host_type_returns_host_type_hostname)
| Ensure (hosts, gvm_get_host_type_returns_host_type_cidr_block)
| Ensure (hosts, gvm_get_host_type_returns_host_type_cidr6_block)
| Ensure (hosts, gvm_get_host_type_returns_host_type_range_short)
| Ensure (hosts, gvm_get_host_type_returns_host_type_range6_short)
| Ensure (hosts, gvm_get_host_type_returns_host_type_range_long)
| Ensure (hosts, gvm_get_host_type_returns_host_type_range6_long)
| Ensure (hosts, gvm_get_host_type_returns_error)
| Ensure (hosts, gvm_hosts_new_with_max_returns_success)
| Ensure (hosts, gvm_hosts_new_with_max_returns_error)
static int | host_value_eq (gvm_host_t *host, gchar *string)
| Ensure (hosts, gvm_hosts_move_host_to_end)
| Ensure (hosts, gvm_hosts_allowed_only)
int | main (int argc, char **argv)

## Macro Definition Documentation

## ◆ ASSERT_HOST_EQUALS

#define ASSERT_HOST_EQUALS | ( |  | hosts,
|  |  | i,
|  |  | string )

Value:
{ \
gchar *value; \
\
value = gvm_host_value_str (hosts->hosts[i]); \
assert_true_with_message ( \
g_strcmp0 (value, string) == 0, \
"Expected hosts->hosts[%d] to be %s but it was %s", i, string, value); \
g_free (value); \
}
gvm_host_value_str
gchar * gvm_host_value_str(const gvm_host_t *host)
Gets a host's value in printable format.
Definition hosts.c:2290

## ◆ HUNDRED

#define HUNDRED TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN

## ◆ SIXTY

#define SIXTY TEN TEN TEN TEN TEN TEN

## ◆ TEN

#define TEN "0123456789"

## Function Documentation

## ◆ AfterEach()

AfterEach | ( | hosts |  | ) |

## ◆ BeforeEach()

BeforeEach | ( | hosts |  | ) |

## ◆ Describe()

Describe | ( | hosts |  | ) |

## ◆ Ensure() [1/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_error | )

## ◆ Ensure() [2/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_cidr6_block | )

## ◆ Ensure() [3/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_cidr_block | )

## ◆ Ensure() [4/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_hostname | )

## ◆ Ensure() [5/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_ipv4 | )

## ◆ Ensure() [6/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_ipv6 | )

## ◆ Ensure() [7/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_range6_long | )

## ◆ Ensure() [8/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_range6_short | )

## ◆ Ensure() [9/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_range_long | )

## ◆ Ensure() [10/15]

Ensure | ( | hosts | ,
|  | gvm_get_host_type_returns_host_type_range_short | )

## ◆ Ensure() [11/15]

Ensure | ( | hosts | ,
|  | gvm_hosts_allowed_only | )

## ◆ Ensure() [12/15]

Ensure | ( | hosts | ,
|  | gvm_hosts_move_host_to_end | )

## ◆ Ensure() [13/15]

Ensure | ( | hosts | ,
|  | gvm_hosts_new_never_returns_null | )

## ◆ Ensure() [14/15]

Ensure | ( | hosts | ,
|  | gvm_hosts_new_with_max_returns_error | )

## ◆ Ensure() [15/15]

Ensure | ( | hosts | ,
|  | gvm_hosts_new_with_max_returns_success | )

## ◆ host_value_eq()

int host_value_eq | ( | gvm_host_t * | host,
|  | gchar * | string )
| static

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv )