#include "test/core/tsi/alts/crypt/gsec_test_util.h"#include <time.h>#include <grpc/support/alloc.h>
Go to the source code of this file.
Functions | |
| uint32_t | gsec_test_bias_random_uint32 (uint32_t max_length) |
| void | gsec_test_copy (const uint8_t *src, uint8_t **des, size_t source_len) |
| void | gsec_test_copy_and_alter_random_byte (const uint8_t *src, uint8_t **des, size_t source_len) |
| int | gsec_test_expect_compare_code_and_substr (grpc_status_code status1, grpc_status_code status2, const char *msg1, const char *msg2) |
| void | gsec_test_random_array (uint8_t **bytes, size_t length) |
| void | gsec_test_random_bytes (uint8_t *bytes, size_t length) |
This method returns a uint32 that's not quite uniformly random, but good enough for tests.
Definition at line 43 of file gsec_test_util.cc.
This method copies data from a source to a destination buffer.
Definition at line 49 of file gsec_test_util.cc.
| void gsec_test_copy_and_alter_random_byte | ( | const uint8_t * | src, |
| uint8_t ** | des, | ||
| size_t | source_len | ||
| ) |
This method copies data from a source to a destination buffer, and flips one byte in the destination buffer randomly.
Definition at line 61 of file gsec_test_util.cc.
| int gsec_test_expect_compare_code_and_substr | ( | grpc_status_code | status1, |
| grpc_status_code | status2, | ||
| const char * | msg1, | ||
| const char * | msg2 | ||
| ) |
This method compares two grpc_status_code values, and verifies if one string is a substring of the other.
If both checks succeed, the method returns 1 and otherwise, it returns 0.
Definition at line 77 of file gsec_test_util.cc.
| void gsec_test_random_array | ( | uint8_t ** | bytes, |
| size_t | length | ||
| ) |
This method returns an array of random bytes.
Definition at line 33 of file gsec_test_util.cc.
| void gsec_test_random_bytes | ( | uint8_t * | bytes, |
| size_t | length | ||
| ) |
This method returns random bytes of certain length.
Definition at line 25 of file gsec_test_util.cc.