190792Sgshapiro/*
2261194Sgshapiro * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
390792Sgshapiro *	All rights reserved.
490792Sgshapiro *
590792Sgshapiro * By using this file, you agree to the terms and conditions set
690792Sgshapiro * forth in the LICENSE file which can be found at the top level of
790792Sgshapiro * the sendmail distribution.
890792Sgshapiro */
990792Sgshapiro
1090792Sgshapiro#include <sm/gen.h>
11266527SgshapiroSM_IDSTR(id, "@(#)$Id: t-strio.c,v 1.12 2013-11-22 20:51:44 ca Exp $")
1290792Sgshapiro#include <sm/string.h>
1390792Sgshapiro#include <sm/io.h>
1490792Sgshapiro#include <sm/test.h>
1590792Sgshapiro
1690792Sgshapiroint
1790792Sgshapiromain(argc, argv)
1890792Sgshapiro	int argc;
1990792Sgshapiro	char *argv[];
2090792Sgshapiro{
2190792Sgshapiro	char buf[20];
2290792Sgshapiro	char *r;
2390792Sgshapiro	SM_FILE_T f;
2490792Sgshapiro
2590792Sgshapiro	sm_test_begin(argc, argv, "test strio");
2690792Sgshapiro	(void) memset(buf, '.', 20);
2790792Sgshapiro	sm_strio_init(&f, buf, 10);
2890792Sgshapiro	(void) sm_io_fprintf(&f, SM_TIME_DEFAULT, "foobarbazoom");
2990792Sgshapiro	sm_io_flush(&f, SM_TIME_DEFAULT);
3090792Sgshapiro	r = "foobarbaz";
3190792Sgshapiro	SM_TEST(strcmp(buf, r) == 0);
3290792Sgshapiro	return sm_test_end();
3390792Sgshapiro}
34