mirror of https://github.com/xemu-project/xemu.git
tests/next for 20170906
-----BEGIN PGP SIGNATURE----- iQIcBAABCAAGBQJZr98lAAoJEPSH7xhYctcjvdcQANVwY7VOGE+0LVLN0wcfcM/7 SflFQOAn1slWykIwRPdXWv7tMlwpWNe+YHMQ8vJOJcO4yytk91m8AA1Bc8cgKVvy YBD6PeXoyn9k/aOIfb9NNQYtTq5kIyQRidsff8BsnRoHiGQ3ICwbK+H1miB48MDO 28pjoU8H3zIgkzi9gBgOc6Ta809H+eqEZ10Ai7d4H65Tg2Q3Pj322ucRJXf1LFr+ GZGgGeDpmlkQMKTphEjf2anaq2lhgBekAAVat6lIK4selggZQDjmfA47A3fvYatU vdzG4pRE8I/Qp8oHhvftQ7vlhP7EMuVoPwvcc+siRSVkICig9T2dFibuPJoWrKHN 4cNRGHZ4nnvnxE7CpxiEZikjoQGUqXIqLqvNJc1kdr+gmif5tMJxzY5+P4EbNQ8M ivfyuofG2bj1Y1yjj57WLhcMHv8xSj0qG2fQ8vwwY4EiOSwF5OUKE5BSxvJ3ElEt ykWygyXPt8iaGASlISYrq0Q6FPeBM6VsGLs0IwTK5CGU51QK2GyZR1104z5btCP1 2jU5L7zXMbp0/OZBJCPmK6w3D7lHMj0oi0nImIen3Z0GYd/PuI6ta752Aq3g9YBV 6/msLHoWMBi7gu2Q/X9WZFj8ykkO8w+nS50TbEUbULiYdVaFhZtEcnyZyqBt+Ht1 nA38okfi90DqjmlM1UPP =oHMc -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/juanquintela/tags/tests/20170906' into staging tests/next for 20170906 # gpg: Signature made Wed 06 Sep 2017 12:42:29 BST # gpg: using RSA key 0xF487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/tests/20170906: tests: Make vmgenid test compile tests: Use real size for iov tests Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
8c6a76cd23
|
@ -31,11 +31,6 @@ size_t iov_size(const struct iovec *iov, const unsigned int iov_cnt);
|
|||
* Number of bytes actually copied will be returned, which is
|
||||
* min(bytes, iov_size(iov)-offset)
|
||||
* `Offset' must point to the inside of iovec.
|
||||
* It is okay to use very large value for `bytes' since we're
|
||||
* limited by the size of the iovec anyway, provided that the
|
||||
* buffer pointed to by buf has enough space. One possible
|
||||
* such "large" value is -1 (sinice size_t is unsigned),
|
||||
* so specifying `-1' as `bytes' means 'up to the end of iovec'.
|
||||
*/
|
||||
size_t iov_from_buf_full(const struct iovec *iov, unsigned int iov_cnt,
|
||||
size_t offset, const void *buf, size_t bytes);
|
||||
|
@ -76,7 +71,6 @@ iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt,
|
|||
* up to the end of it, will be filled with the specified value.
|
||||
* Function return actual number of bytes processed, which is
|
||||
* min(size, iov_size(iov) - offset).
|
||||
* Again, it is okay to use large value for `bytes' to mean "up to the end".
|
||||
*/
|
||||
size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt,
|
||||
size_t offset, int fillc, size_t bytes);
|
||||
|
|
|
@ -81,17 +81,17 @@ static void test_to_from_buf_1(void)
|
|||
* skip whole vector and process exactly 0 bytes */
|
||||
|
||||
/* first set bytes [i..sz) to some "random" value */
|
||||
n = iov_memset(iov, niov, 0, 0xff, -1);
|
||||
n = iov_memset(iov, niov, 0, 0xff, sz);
|
||||
g_assert(n == sz);
|
||||
|
||||
/* next copy bytes [i..sz) from ibuf to iovec */
|
||||
n = iov_from_buf(iov, niov, i, ibuf + i, -1);
|
||||
n = iov_from_buf(iov, niov, i, ibuf + i, sz - i);
|
||||
g_assert(n == sz - i);
|
||||
|
||||
/* clear part of obuf */
|
||||
memset(obuf + i, 0, sz - i);
|
||||
/* and set this part of obuf to values from iovec */
|
||||
n = iov_to_buf(iov, niov, i, obuf + i, -1);
|
||||
n = iov_to_buf(iov, niov, i, obuf + i, sz - i);
|
||||
g_assert(n == sz - i);
|
||||
|
||||
/* now compare resulting buffers */
|
||||
|
@ -109,7 +109,7 @@ static void test_to_from_buf_1(void)
|
|||
* with j in [i..sz]. */
|
||||
|
||||
/* clear iovec */
|
||||
n = iov_memset(iov, niov, 0, 0xff, -1);
|
||||
n = iov_memset(iov, niov, 0, 0xff, sz);
|
||||
g_assert(n == sz);
|
||||
|
||||
/* copy bytes [i..j) from ibuf to iovec */
|
||||
|
@ -225,7 +225,7 @@ static void test_io(void)
|
|||
for (i = 0; i <= sz; ++i) {
|
||||
for (j = i; j <= sz; ++j) {
|
||||
k = i;
|
||||
iov_memset(iov, niov, 0, 0xff, -1);
|
||||
iov_memset(iov, niov, 0, 0xff, sz);
|
||||
do {
|
||||
s = g_test_rand_int_range(0, j - k + 1);
|
||||
r = iov_recv(sv[0], iov, niov, k, s);
|
||||
|
|
|
@ -40,7 +40,7 @@ static uint32_t acpi_find_vgia(void)
|
|||
AcpiRsdpDescriptor rsdp_table;
|
||||
uint32_t rsdt;
|
||||
AcpiRsdtDescriptorRev1 rsdt_table;
|
||||
int tables_nr;
|
||||
size_t tables_nr;
|
||||
uint32_t *tables;
|
||||
AcpiTableHeader ssdt_table;
|
||||
VgidTable vgid_table;
|
||||
|
@ -62,9 +62,9 @@ static uint32_t acpi_find_vgia(void)
|
|||
ACPI_ASSERT_CMP(rsdt_table.signature, "RSDT");
|
||||
|
||||
/* compute the table entries in rsdt */
|
||||
g_assert_cmpint(rsdt_table.length, >, sizeof(AcpiRsdtDescriptorRev1));
|
||||
tables_nr = (rsdt_table.length - sizeof(AcpiRsdtDescriptorRev1)) /
|
||||
sizeof(uint32_t);
|
||||
g_assert_cmpint(tables_nr, >, 0);
|
||||
|
||||
/* get the addresses of the tables pointed by rsdt */
|
||||
tables = g_new0(uint32_t, tables_nr);
|
||||
|
|
Loading…
Reference in New Issue