/*++ /* NAME /* mock_stat 3 /* SUMMARY /* test scaffolding /* SYNOPSIS /* #include <mock_stat.h> /* /* typedef struct MOCK_STAT_REQ { /* .in +4 /* const char *want_path; /* int out_errno; /* struct stat st; /* .in -4 /* } MOCK_STAT_REQ; /* /* void setup_mock_stat(const MOCK_STAT_REQ *request) /* /* void teardown_mock_stat(void) /* DESCRIPTION /* This module provides a mock stat() implementation that returns /* static results for expected calls. /* /* setup_mock_stat() adds a mapping from pathname to struct /* stat_info pointer. It is an error to enter multiple mappings /* for one pathname. If makes a shallow copy ig its input: /* .IP want_path /* The lookup key for file status information. /* .IP out_errno /* If non-zero, mock stat() will return -1 and set the global /* errno variable. /* .IP st /* File status information, ignored when out_errno is non-zero. /* .PP /* teardown_mock_stat() destroys all mappings entered with /* setup_mock_stat(). /* /* The mock stat() function looks up the MOCK_STAT_REQ information /* for a pathname and terminates the test if the pathname is not /* expected. If the mapping contains a non-zero out_errno value, /* it simulates an error, sets the global errno value, and returns /* -1. Otherwise it copies the stat_info.st value to the storage /* provided with the st argument. /* SEE ALSO /* stat(2), the real thing /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* porcupine.org
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.