[prev in list] [next in list] [prev in thread] [next in thread]
List: ltp-cvs
Subject: [Ltp-cvs] ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return 1-1.c,NONE,1.1 2-1.c,
From: Robert Williamson <robbiew () users ! sourceforge ! net>
Date: 2004-12-20 17:04:22
Message-ID: E1CgQxK-00083F-Ml () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/ltp/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30688/conformance/interfaces/aio_return
Added Files:
1-1.c 2-1.c 3-1.c 3-2.c 4-1.c assertions.xml coverage.txt
Log Message:
Update to Version 1.5.0
--- NEW FILE: assertions.xml ---
<assertions>
<assertion id="1" tag="ref:XSH6TC2:4220:4221">
aio_return() shall return the status associated with aiocbp.
</assertion>
<assertion id="2" tag="ref:XSH6TC2:4224:4226">
aio_return() may be called exactly once to retrieve the return status.
</assertion>
<assertion id="3" tag="ref:XSH6TC2:4226:4228">
If the aiocbp is used to submit another asynchronous operation,
the aio_return may be successfully used to retrieve the return status.
</assertion>
<assertion id="4" tag="ref:XSH6TC2:4235:4236">
aio_return() may fail if:
[EINVAL] The aiocbp does not refer to an operation whose return status
has not yet been retrieved.
</assertion>
</assertions>
--- NEW FILE: coverage.txt ---
this file defines the coverage for the aio_return() function testing.
Assertion Covered?
1 NO
2 NO
3 NO
4 NO
--- NEW FILE: 3-2.c ---
/*
* Copyright (c) 2004, IBM Corporation. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*/
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <aio.h>
#include "posixtest.h"
#define TNAME "aio_return/3-1.c"
int main()
{
char tmpfname[256];
#define BUF_SIZE 4096
char buf[BUF_SIZE];
int fd;
struct aiocb aiocb;
int retval;
#if _POSIX_ASYNCHRONOUS_IO != 200112L
exit(PTS_UNSUPPORTED);
#endif
snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_return_3_1_%d",
getpid());
unlink(tmpfname);
fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL,
S_IRUSR | S_IWUSR);
if (fd == -1)
{
printf(TNAME " Error at open(): %s\n",
strerror(errno));
exit(PTS_UNRESOLVED);
}
unlink(tmpfname);
memset(buf, 0xaa, BUF_SIZE);
memset(&aiocb, 0, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = BUF_SIZE;
if (aio_write(&aiocb) == -1)
{
printf(TNAME " Error at aio_write(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
do {
retval = aio_error( &aiocb);
if (retval == -1)
{
printf(TNAME " Error at aio_error(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
} while (retval == EINPROGRESS);
retval = aio_return(&aiocb);
if (retval != BUF_SIZE)
{
printf(TNAME " Error at aio_return(): %d, %s\n", retval,
strerror(errno));
exit(PTS_FAIL);
}
retval = aio_return(&aiocb);
if ( (retval != -1) && (errno != EINVAL) )
{
printf(TNAME " aio_return() should fail\n");
exit(PTS_FAIL);
}
close(fd);
printf ("Test PASSED\n");
return PTS_PASS;
}
--- NEW FILE: 1-1.c ---
/*
* Copyright (c) 2004, IBM Corporation. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*/
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <aio.h>
#include "posixtest.h"
#define TNAME "aio_return/1-1.c"
int main()
{
char tmpfname[256];
#define BUF_SIZE 111
char buf[BUF_SIZE];
int fd;
struct aiocb aiocb;
int retval;
#if _POSIX_ASYNCHRONOUS_IO != 200112L
exit(PTS_UNSUPPORTED);
#endif
snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_return_1_1_%d",
getpid());
unlink(tmpfname);
fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL,
S_IRUSR | S_IWUSR);
if (fd == -1)
{
printf(TNAME " Error at open(): %s\n",
strerror(errno));
exit(PTS_UNRESOLVED);
}
unlink(tmpfname);
memset(buf, 0xaa, BUF_SIZE);
memset(&aiocb, 0, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = BUF_SIZE;
if (aio_write(&aiocb) == -1)
{
printf(TNAME " Error at aio_write(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
close(fd);
do {
retval = aio_error( &aiocb);
if (retval == -1)
{
printf(TNAME " Error at aio_error(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
} while (retval == EINPROGRESS);
retval = aio_return(&aiocb);
if (retval != BUF_SIZE)
{
printf(TNAME " Error at aio_return(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
printf ("Test PASSED\n");
return PTS_PASS;
}
--- NEW FILE: 2-1.c ---
/*
* Copyright (c) 2004, IBM Corporation. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*/
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <unistd.h>
#include <aio.h>
#include "posixtest.h"
int main()
{
#if _POSIX_ASYNCHRONOUS_IO != 200112L
exit(PTS_UNSUPPORTED);
#endif
return PTS_UNTESTED;
}
--- NEW FILE: 3-1.c ---
/*
* Copyright (c) 2004, IBM Corporation. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*/
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <aio.h>
#include "posixtest.h"
#define TNAME "aio_return/3-1.c"
int main()
{
char tmpfname[256];
#define BUF_SIZE 4096
char buf[BUF_SIZE];
int fd;
struct aiocb aiocb;
int retval;
#if _POSIX_ASYNCHRONOUS_IO != 200112L
exit(PTS_UNSUPPORTED);
#endif
snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_return_3_1_%d",
getpid());
unlink(tmpfname);
fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL,
S_IRUSR | S_IWUSR);
if (fd == -1)
{
printf(TNAME " Error at open(): %s\n",
strerror(errno));
exit(PTS_UNRESOLVED);
}
unlink(tmpfname);
memset(buf, 0xaa, BUF_SIZE);
memset(&aiocb, 0, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = BUF_SIZE;
if (aio_write(&aiocb) == -1)
{
printf(TNAME " Error at aio_write(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
do {
retval = aio_error( &aiocb);
if (retval == -1)
{
printf(TNAME " Error at aio_error(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
} while (retval == EINPROGRESS);
retval = aio_return(&aiocb);
if (retval != BUF_SIZE)
{
printf(TNAME " Error at aio_return(): %d, %s\n", retval,
strerror(errno));
exit(PTS_FAIL);
}
memset(&aiocb, 0, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = BUF_SIZE/2;
if (aio_write(&aiocb) == -1)
{
printf(TNAME " Error at aio_write(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
do {
retval = aio_error( &aiocb);
if (retval == -1)
{
printf(TNAME " Error at aio_error(): %s\n",
strerror(errno));
exit(PTS_FAIL);
}
} while (retval == EINPROGRESS);
close(fd);
retval = aio_return(&aiocb);
if (retval != BUF_SIZE / 2)
{
printf(TNAME " Error at aio_return(): %d, %s\n", retval,
strerror(errno));
exit(PTS_FAIL);
}
printf ("Test PASSED\n");
return PTS_PASS;
}
--- NEW FILE: 4-1.c ---
/*
* Copyright (c) 2004, IBM Corporation. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*/
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <unistd.h>
#include <aio.h>
#include "posixtest.h"
int main()
{
#if _POSIX_ASYNCHRONOUS_IO != 200112L
exit(PTS_UNSUPPORTED);
#endif
return PTS_UNTESTED;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic