diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-12-31 08:42:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:49:11 -0500 |
commit | 76480dba70002a5e43a59319c3cc6b41e8388330 (patch) | |
tree | 944f4ce115a2894a02098a818e881e97659a70d9 /source4 | |
parent | d73156d2c49c7876e2c396c207a02f575ca43fbe (diff) | |
download | samba-76480dba70002a5e43a59319c3cc6b41e8388330.tar.gz samba-76480dba70002a5e43a59319c3cc6b41e8388330.tar.bz2 samba-76480dba70002a5e43a59319c3cc6b41e8388330.zip |
r12639: - do some tests with 0x20 0x1B names
- do some tests with 0xBF and 0xBE, this shows that the '+' padding
should be done by the client
metze
(This used to be commit 5a257ba9811b247a0df2b44c99df00f59dacc1e0)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/nbt/wins.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index 76f26ac1c0..37e9688a60 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -25,8 +25,8 @@ #define CHECK_VALUE(v, correct) do { \ if ((v) != (correct)) { \ - printf("(%s) Incorrect value %s=%d - should be %d\n", \ - __location__, #v, v, correct); \ + printf("(%s) Incorrect value %s=%d (0x%X) - should be %d (0x%X)\n", \ + __location__, #v, v, v, correct, correct); \ ret = False; \ }} while (0) @@ -40,7 +40,7 @@ #define CHECK_NAME(_name, correct) do { \ CHECK_STRING((_name).name, (correct).name); \ - CHECK_VALUE((_name).type, (correct).type); \ + CHECK_VALUE((uint8_t)(_name).type, (uint8_t)(correct).type); \ CHECK_STRING((_name).scope, (correct).scope); \ } while (0) @@ -293,7 +293,7 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address) uint32_t r = (uint32_t)(random() % (100000)); name.name = talloc_asprintf(mem_ctx, "_TORTURE-%5u", r); - + name.type = NBT_NAME_CLIENT; name.scope = NULL; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); @@ -303,12 +303,24 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address) ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP); + name.type = NBT_NAME_SERVER; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + name.type = NBT_NAME_LOGON; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP); name.type = NBT_NAME_BROWSER; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP); + name.type = NBT_NAME_PDC; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + + name.type = 0xBF; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + + name.type = 0xBE; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + name.scope = "example"; name.type = 0x72; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); |