1N/A/*
1N/A * Copyright (c) 2000-2001 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-strio.c,v 1.9 2001/03/03 04:00:53 ca Exp $")
1N/A#include <sm/string.h>
1N/A#include <sm/io.h>
1N/A#include <sm/test.h>
1N/A
1N/Aint
1N/Amain(argc, argv)
1N/A int argc;
1N/A char *argv[];
1N/A{
1N/A char buf[20];
1N/A char *r;
1N/A SM_FILE_T f;
1N/A
1N/A sm_test_begin(argc, argv, "test strio");
1N/A (void) memset(buf, '.', 20);
1N/A sm_strio_init(&f, buf, 10);
1N/A (void) sm_io_fprintf(&f, SM_TIME_DEFAULT, "foobarbazoom");
1N/A sm_io_flush(&f, SM_TIME_DEFAULT);
1N/A r = "foobarbaz";
1N/A SM_TEST(strcmp(buf, r) == 0);
1N/A return sm_test_end();
1N/A}