summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-29 21:27:18 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-29 21:38:23 +0200
commitc38e96278a8ec1ccdff33e14a751bfcb8c3d63bf (patch)
treeca504a2e5556f055e539f4830a6c166bb4c9c6f6 /source4
parent50d26133dcc2b7866bb877fa80af2fc6dca144dc (diff)
downloadsamba-c38e96278a8ec1ccdff33e14a751bfcb8c3d63bf.tar.gz
samba-c38e96278a8ec1ccdff33e14a751bfcb8c3d63bf.tar.bz2
samba-c38e96278a8ec1ccdff33e14a751bfcb8c3d63bf.zip
s4:registry/tests/generic.c - fix the DWORD_* types test to work also against big endian platforms
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/tests/generic.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 206fad0d41..75b6c7ff26 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -62,8 +62,8 @@ static bool test_str_regtype(struct torture_context *ctx)
static bool test_reg_val_data_string_dword(struct torture_context *ctx)
{
- uint32_t d = 0x20;
- DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
+ uint8_t d[] = { 0x20, 0x00, 0x00, 0x00 };
+ DATA_BLOB db = { d, 4 };
torture_assert_str_equal(ctx, "0x00000020",
reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD, db),
"dword failed");
@@ -72,8 +72,8 @@ static bool test_reg_val_data_string_dword(struct torture_context *ctx)
static bool test_reg_val_data_string_dword_big_endian(struct torture_context *ctx)
{
- uint32_t d = 0x20;
- DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
+ uint8_t d[] = { 0x20, 0x00, 0x00, 0x00 };
+ DATA_BLOB db = { d, 4 };
torture_assert_str_equal(ctx, "0x00000020",
reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD_BIG_ENDIAN, db),
"dword failed");
@@ -82,8 +82,8 @@ static bool test_reg_val_data_string_dword_big_endian(struct torture_context *ct
static bool test_reg_val_data_string_qword(struct torture_context *ctx)
{
- uint64_t d = 0x20;
- DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
+ uint8_t d[] = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ DATA_BLOB db = { d, 8 };
torture_assert_str_equal(ctx, "0x0000000000000020",
reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_QWORD, db),
"qword failed");