# Struct ring::test::TestCase [−] [src]

    pub struct TestCase { /* fields omitted */ }

A test case. A test case consists of a set of named attributes. Every attribute in the test case must be consumed exactly once; this helps catch typos and omissions.

## Methods

### `impl TestCase`
[src]

#### `fn consume_digest_alg(&mut self, key: &str) -> Option<&'static Algorithm>`

Maps the strings "SHA1", "SHA256", "SHA384", and "SHA512" to digest algorithms, maps "SHA224" to `None`, and panics on other (erroneous) inputs. "SHA224" is mapped to None because ring intentionally does not support SHA224, but we need to consume test vectors from NIST that have SHA224 vectors in them.

#### `fn consume_bytes(&mut self, key: &str) -> Vec<u8>`

Returns the value of an attribute that is encoded as a sequence of an even number of hex digits, or as a double-quoted UTF-8 string. The empty (zero-length) value is represented as "".

#### `fn consume_usize(&mut self, key: &str) -> usize`

Returns the value of an attribute that is an integer, in decimal notation.

#### `fn consume_usize_bits(&mut self, key: &str) -> BitLength`

Returns the value of an attribute that is an integer, in decimal notation, as a bit length.

#### `fn consume_string(&mut self, key: &str) -> String`

Returns the raw value of an attribute, without any unquoting or other interpretation.

#### `fn consume_optional_string(&mut self, key: &str) -> Option<String>`

Like `consume_string()` except it returns `None` if the test case doesn't have the attribute.

## Trait Implementations

### `impl Debug for TestCase`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

Formats the value using the given formatter.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)