t-strio.c revision 261363
167760Smsmith/*
283181Smsmith * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
367760Smsmith *	All rights reserved.
467760Smsmith *
567760Smsmith * By using this file, you agree to the terms and conditions set
667760Smsmith * forth in the LICENSE file which can be found at the top level of
767760Smsmith * the sendmail distribution.
867760Smsmith */
967760Smsmith
1067760Smsmith#include <sm/gen.h>
1167760SmsmithSM_IDSTR(id, "@(#)$Id: t-strio.c,v 1.12 2013/11/22 20:51:44 ca Exp $")
1267760Smsmith#include <sm/string.h>
1367760Smsmith#include <sm/io.h>
1467760Smsmith#include <sm/test.h>
1567760Smsmith
1667760Smsmithint
1767760Smsmithmain(argc, argv)
1867760Smsmith	int argc;
1967760Smsmith	char *argv[];
2067760Smsmith{
2167760Smsmith	char buf[20];
2267760Smsmith	char *r;
2367760Smsmith	SM_FILE_T f;
2467760Smsmith
2567760Smsmith	sm_test_begin(argc, argv, "test strio");
2667760Smsmith	(void) memset(buf, '.', 20);
2767760Smsmith	sm_strio_init(&f, buf, 10);
28118030Sobrien	(void) sm_io_fprintf(&f, SM_TIME_DEFAULT, "foobarbazoom");
29118030Sobrien	sm_io_flush(&f, SM_TIME_DEFAULT);
30118030Sobrien	r = "foobarbaz";
3167760Smsmith	SM_TEST(strcmp(buf, r) == 0);
3267760Smsmith	return sm_test_end();
3367760Smsmith}
34108026Smarcel