Commit c9443aa7 authored by Niels Möller's avatar Niels Möller

Fix pointer sign warnings for sexp-format-test.

parent 974514e1
2016-09-03 Niels Möller <nisse@lysator.liu.se>
* testsuite/rsa-encrypt-test.c (test_main): Fix pointer
signednesss warning.
* testsuite/testutils.h (US): New macro, for unsigned string
literals.
(LDATA): Use the US macro, to eliminate pointer signedness
......@@ -19,6 +16,8 @@
* testsuite/yarrow-test.c (test_main): Fix pointer
signednesss warning.
* testsuite/sexp-format-test.c (test_main): Likewise.
* testsuite/rsa-encrypt-test.c (test_main): Likewise.
* testsuite/testutils.c (test_armor): Change ascii argument to
const char *.
......
......@@ -13,7 +13,7 @@ test_main(void)
struct nettle_buffer buffer;
{
const uint8_t e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
const char e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0s(%0s%0s))",
......@@ -29,7 +29,7 @@ test_main(void)
nettle_buffer_clear(&buffer);
}
{
const uint8_t e[] = "{KDM6Zm9vKDM6YmFyMTc6eHh4eHh4eHh4eHh4eHh4eHgpKQ==}";
const char e[] = "{KDM6Zm9vKDM6YmFyMTc6eHh4eHh4eHh4eHh4eHh4eHgpKQ==}";
nettle_buffer_init(&buffer);
ASSERT(sexp_transport_format(&buffer, "(%0s(%0s%0s))",
......@@ -45,7 +45,7 @@ test_main(void)
nettle_buffer_clear(&buffer);
}
{
const uint8_t e[] = "1:\0""1:a2:bc3:def4:ghij5:\x00\xDE\xAD\xBE\xEF";
const char e[] = "1:\0""1:a2:bc3:def4:ghij5:\x00\xDE\xAD\xBE\xEF";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "%i%i%i%i%i%i",
......@@ -58,7 +58,7 @@ test_main(void)
}
{
const uint8_t e[] = "(3:foo(4:bar))";
const char e[] = "(3:foo(4:bar))";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0s%l)",
......@@ -71,7 +71,7 @@ test_main(void)
}
{
const uint8_t e[] = "([1:t]3:foo3:bar[6:gazonk]3:baz1:q)";
const char e[] = "([1:t]3:foo3:bar[6:gazonk]3:baz1:q)";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0t%0s%0s%0t%0s%0t%0s)",
......@@ -84,7 +84,7 @@ test_main(void)
/* Try literals */
{
const uint8_t e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
const char e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0s(bar%0s))",
......@@ -100,7 +100,7 @@ test_main(void)
nettle_buffer_clear(&buffer);
}
{
const uint8_t e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
const char e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0s(bar xxxxxxxxxxxxxxxxx))",
......@@ -118,7 +118,7 @@ test_main(void)
/* Literal parenthesis */
{
const uint8_t e[] = ")3:foo(3:bar";
const char e[] = ")3:foo(3:bar";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "%)foo%(%s", (size_t) 3, "bar")
......@@ -138,12 +138,12 @@ test_main(void)
mpz_t y;
mpz_t z;
const uint8_t e[] =
const char e[] =
"(3:foo(3:bar1:\xff""11:abcdefghijk13:\0\x81""abcdefghijk))";
mpz_init_set_si(x, -1);
nettle_mpz_init_set_str_256_u(y, 11, "abcdefghijk");
nettle_mpz_init_set_str_256_u(z, 12, "\x81""abcdefghijk");
nettle_mpz_init_set_str_256_u(y, 11, US("abcdefghijk"));
nettle_mpz_init_set_str_256_u(z, 12, US("\x81""abcdefghijk"));
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "(%0s(%0s%b%b%b))",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment