Greenbone Vulnerability Management Libraries: util/streamvalidator_tests.c File Reference

Greenbone Vulnerability Management Libraries 23.7.0

Macros | Functions
streamvalidator_tests.c File Reference
`#include "streamvalidator.h"`
`#include <assert.h>`
`#include <cgreen/cgreen.h>`
`#include <cgreen/mocks.h>`

## Macros
#define | VALID_DATA "This should be valid...."
#define | TOO_SHORT_DATA "This is too short!"
#define | TOO_LONG_DATA "This text is longer than expected!"
#define | INVALID_DATA "This shouldn't be valid!"
#define | VALID_DATA_HASH "sha256:4ae8f10c9e9551173520b7a675e9caba163007edf04dbbd06022bf61ad3fe4fb"

## Functions
| Describe (streamvalidator)
| BeforeEach (streamvalidator)
| AfterEach (streamvalidator)
| Ensure (streamvalidator, accepts_valid_data)
| Ensure (streamvalidator, accepts_valid_data_after_multiple_writes)
| Ensure (streamvalidator, accepts_valid_data_after_rewind)
| Ensure (streamvalidator, rejects_too_long_data)
| Ensure (streamvalidator, rejects_too_short_data)
| Ensure (streamvalidator, rejects_hash_mismatch)
| Ensure (streamvalidator, init_rejects_empty_hash)
| Ensure (streamvalidator, init_rejects_invalid_syntax_hashes)
| Ensure (streamvalidator, init_rejects_invalid_algo_hashes)
| Ensure (streamvalidator, init_rejects_invalid_value_hashes)
| Ensure (streamvalidator, accepts_valid_checksum_only_without_size)
| Ensure (streamvalidator, rejects_checksum_with_extra_colon_suffix_as_invalid_hex)
| Ensure (streamvalidator, enforces_size_from_arg_when_no_suffix)
| Ensure (streamvalidator, checksum_only_extra_bytes_yield_hash_mismatch)
| Ensure (streamvalidator, init_rejects_invalid_syntax_algo_and_value)
| Ensure (streamvalidator, return_str_ok_is_null)
| Ensure (streamvalidator, return_str_maps_known_codes)
| Ensure (streamvalidator, return_str_unknown_code_yields_unknown_error)
| Ensure (streamvalidator, wrapper_checksum_only_accepts_valid_data)
| Ensure (streamvalidator, wrapper_checksum_only_does_not_enforce_size)
| Ensure (streamvalidator, wrapper_rejects_invalid_hash_syntax)
int | main (int argc, char **argv)

## Macro Definition Documentation

## ◆ INVALID_DATA

#define INVALID_DATA "This shouldn't be valid!"

## ◆ TOO_LONG_DATA

#define TOO_LONG_DATA "This text is longer than expected!"

## ◆ TOO_SHORT_DATA

#define TOO_SHORT_DATA "This is too short!"

## ◆ VALID_DATA

#define VALID_DATA "This should be valid...."

## ◆ VALID_DATA_HASH

#define VALID_DATA_HASH "sha256:4ae8f10c9e9551173520b7a675e9caba163007edf04dbbd06022bf61ad3fe4fb"

## Function Documentation

## ◆ AfterEach()

AfterEach | ( | streamvalidator |  | ) |

## ◆ BeforeEach()

BeforeEach | ( | streamvalidator |  | ) |

## ◆ Describe()

Describe | ( | streamvalidator |  | ) |

## ◆ Ensure() [1/21]

Ensure | ( | streamvalidator | ,
|  | accepts_valid_checksum_only_without_size | )

## ◆ Ensure() [2/21]

Ensure | ( | streamvalidator | ,
|  | accepts_valid_data | )

## ◆ Ensure() [3/21]

Ensure | ( | streamvalidator | ,
|  | accepts_valid_data_after_multiple_writes | )

## ◆ Ensure() [4/21]

Ensure | ( | streamvalidator | ,
|  | accepts_valid_data_after_rewind | )

## ◆ Ensure() [5/21]

Ensure | ( | streamvalidator | ,
|  | checksum_only_extra_bytes_yield_hash_mismatch | )

## ◆ Ensure() [6/21]

Ensure | ( | streamvalidator | ,
|  | enforces_size_from_arg_when_no_suffix | )

## ◆ Ensure() [7/21]

Ensure | ( | streamvalidator | ,
|  | init_rejects_empty_hash | )

## ◆ Ensure() [8/21]

Ensure | ( | streamvalidator | ,
|  | init_rejects_invalid_algo_hashes | )

## ◆ Ensure() [9/21]

Ensure | ( | streamvalidator | ,
|  | init_rejects_invalid_syntax_algo_and_value | )

## ◆ Ensure() [10/21]

Ensure | ( | streamvalidator | ,
|  | init_rejects_invalid_syntax_hashes | )

## ◆ Ensure() [11/21]

Ensure | ( | streamvalidator | ,
|  | init_rejects_invalid_value_hashes | )

## ◆ Ensure() [12/21]

Ensure | ( | streamvalidator | ,
|  | rejects_checksum_with_extra_colon_suffix_as_invalid_hex | )

## ◆ Ensure() [13/21]

Ensure | ( | streamvalidator | ,
|  | rejects_hash_mismatch | )

## ◆ Ensure() [14/21]

Ensure | ( | streamvalidator | ,
|  | rejects_too_long_data | )

## ◆ Ensure() [15/21]

Ensure | ( | streamvalidator | ,
|  | rejects_too_short_data | )

## ◆ Ensure() [16/21]

Ensure | ( | streamvalidator | ,
|  | return_str_maps_known_codes | )

## ◆ Ensure() [17/21]

Ensure | ( | streamvalidator | ,
|  | return_str_ok_is_null | )

## ◆ Ensure() [18/21]

Ensure | ( | streamvalidator | ,
|  | return_str_unknown_code_yields_unknown_error | )

## ◆ Ensure() [19/21]

Ensure | ( | streamvalidator | ,
|  | wrapper_checksum_only_accepts_valid_data | )

## ◆ Ensure() [20/21]

Ensure | ( | streamvalidator | ,
|  | wrapper_checksum_only_does_not_enforce_size | )

## ◆ Ensure() [21/21]

Ensure | ( | streamvalidator | ,
|  | wrapper_rejects_invalid_hash_syntax | )

## ◆ main()

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