1N/A/*
1N/A * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
1N/A * All rights reserved.
1N/A *
1N/A * By using this file, you agree to the terms and conditions set
1N/A * forth in the LICENSE file which can be found at the top level of
1N/A * the sendmail distribution.
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#include <sm/gen.h>
1N/ASM_IDSTR(id, "@(#)$Id: t-fopen.c,v 1.9 2002/02/06 23:57:45 ca Exp $")
1N/A
1N/A#include <fcntl.h>
1N/A#include <sm/io.h>
1N/A#include <sm/test.h>
1N/A
1N/A/* ARGSUSED0 */
1N/Aint
1N/Amain(argc, argv)
1N/A int argc;
1N/A char *argv[];
1N/A{
1N/A int m, r;
1N/A SM_FILE_T *out;
1N/A
1N/A sm_test_begin(argc, argv, "test sm_io_fopen");
1N/A out = sm_io_fopen("foo", O_WRONLY|O_APPEND|O_CREAT, 0666);
1N/A SM_TEST(out != NULL);
1N/A if (out != NULL)
1N/A {
1N/A (void) sm_io_fprintf(out, SM_TIME_DEFAULT, "foo\n");
1N/A r = sm_io_getinfo(out, SM_IO_WHAT_MODE, &m);
1N/A SM_TEST(r == 0);
1N/A SM_TEST(m == SM_IO_WRONLY);
1N/A sm_io_close(out, SM_TIME_DEFAULT);
1N/A }
1N/A return sm_test_end();
1N/A}