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

Greenbone Vulnerability Management Libraries 23.1.1

Macros | Functions
cvss_tests.c File Reference
`#include "cvss.c"`
`#include <cgreen/cgreen.h>`
`#include <cgreen/mocks.h>`
`#include <math.h>`

## Macros
#define | CHECK(vector, score)

## Functions
| Describe (cvss)
| BeforeEach (cvss)
| AfterEach (cvss)
| Ensure (cvss, roundup_succeeds)
| Ensure (cvss, get_cvss_score_from_base_metrics_null)
static double | nearest (double cvss)
| Ensure (cvss, get_cvss_score_from_base_metrics_succeeds)
| Ensure (cvss, get_cvss_score_from_base_metrics_succeeds_v3)
| Ensure (cvss, get_cvss_score_from_base_metrics_succeeds_v4)
| Ensure (cvss, get_cvss_score_from_base_metrics_fails)
| Ensure (cvss, get_cvss_score_from_base_metrics_fails_v4)
| Ensure (cvss, get_cvss_score_from_base_metrics_all_in_feed_match)
int | main (int argc, char **argv)

## Macro Definition Documentation

## ◆ CHECK

#define CHECK | ( |  | vector,
|  |  | score )

Value:
assert_that_double (nearest (get_cvss_score_from_base_metrics (vector)), \
is_equal_to_double (score))
get_cvss_score_from_base_metrics
double get_cvss_score_from_base_metrics(const char *cvss_str)
Calculate CVSS Score.
Definition cvss.c:585
nearest
static double nearest(double cvss)
Definition cvss_tests.c:46

## Function Documentation

## ◆ AfterEach()

AfterEach | ( | cvss |  | ) |

## ◆ BeforeEach()

BeforeEach | ( | cvss |  | ) |

## ◆ Describe()

Describe | ( | cvss |  | ) |

## ◆ Ensure() [1/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_all_in_feed_match | )

## ◆ Ensure() [2/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_fails | )

## ◆ Ensure() [3/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_fails_v4 | )

## ◆ Ensure() [4/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_null | )

## ◆ Ensure() [5/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_succeeds | )

## ◆ Ensure() [6/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_succeeds_v3 | )

## ◆ Ensure() [7/8]

Ensure | ( | cvss | ,
|  | get_cvss_score_from_base_metrics_succeeds_v4 | )

## ◆ Ensure() [8/8]

Ensure | ( | cvss | ,
|  | roundup_succeeds | )

## ◆ main()

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

## ◆ nearest()

double nearest | ( | double | cvss | ) |
| static