Compare the scratch buffer to the specified expected buffer.

Synopsis

Declared in <bsls_outputredirector.h>

int
compare(
    char const* expected,
    size_t expectedLength) const;

Description

Compare the character buffer pointed to by the specified pointer expected with any output that has been loaded into the scratch buffer. The length of the expected buffer is supplied in the specified expectedLength. Return 0 if the expected buffer has the same length and contents as the scratch buffer, and non‐zero otherwise. Note that the expected buffer is allowed to contain embedded nulls. The behavior is undefined unless enable has previously been called successfully.

Return Value

0 if the buffers match; non‐zero otherwise

Parameters

Name

Description

expected

buffer of characters to compare against the scratch buffer

expectedLength

length of the expected buffer in bytes

Created with MrDocs