/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* ** File: append.c ** Description: Testing File writes where PR_APPEND was used on open ** ** append attempts to verify that a file opened with PR_APPEND ** will always append to the end of file, regardless where the ** current file pointer is positioned. To do this, PR_Seek() is ** called before each write with the position set to beginning of ** file. Subsequent writes should always append. ** The file is read back, summing the integer data written to the ** file. If the expected result is equal, the test passes. ** ** See BugSplat: 4090
*/ #include"plgetopt.h" #include"nspr.h"
#include <stdio.h> #include <stdlib.h>
PRIntn debug = 0;
PRIntn verbose = 0;
PRBool failedAlready = PR_FALSE; const PRInt32 addedBytes = 1000; const PRInt32 buf = 1; /* constant written to fd, addedBytes times */
PRInt32 inBuf; /* read it back into here */
int main(int argc, char** argv) {
PRStatus rc;
PRInt32 rv;
PRFileDesc* fd;
PRIntn i;
PRInt32 sum = 0;
{ /* Get command line options */
PLOptStatus os;
PLOptState* opt = PL_CreateOptState(argc, argv, "vd");
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.