/**
 * testutils: Assorted and sundry helper functions for writing test
 * cases.
 */

#ifndef TESTUTILS_H
#define TESTUTILS_H

#include "persifs.h"
#include "superblob.h"

/**
 * Terminate immediately and indicate failure, with the specified
 * error message.
 */
void fail(const str & err = str(""));

/**
 * An error callback that prints the error value and fails.
 */
void failCBE(pStat s);

/**
 * Generate a random block fingerprint
 */
blockFingerprint randomFingerprint();

/**
 * Generate a random block address
 */
blockAddress randomAddress();

/**
 * Read a file into a string
 */
str readFile(const char *fname);

#endif // TESTUTILS_H
