Commit 294573a5 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

snmpapi: Correct snmpapi tests under win98.

parent b483b680
......@@ -92,10 +92,14 @@ static void test_SnmpUtilOidToA(void)
"1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1";
static const char expect4[] = "-1";
/* This crashes under win98 */
if(0)
{
ret = SnmpUtilOidToA(NULL);
ok(ret != NULL, "SnmpUtilOidToA failed\n");
ok(!strcmp(ret, expect0), "SnmpUtilOidToA failed got \n%s\n expected \n%s\n",
ret, expect1);
}
ret = SnmpUtilOidToA(&oid0);
ok(ret != NULL, "SnmpUtilOidToA failed\n");
......@@ -195,6 +199,9 @@ static void test_SnmpUtilOidCpyFree(void)
static UINT ids[] = { 1, 3, 6, 1, 4, 1, 311 };
static AsnObjectIdentifier dst, src = { sizeof(ids) / sizeof(ids[0]), ids };
/* These crashes under win98 */
if(0)
{
ret = SnmpUtilOidCpy(NULL, NULL);
ok(!ret, "SnmpUtilOidCpy succeeded\n");
......@@ -206,6 +213,7 @@ static void test_SnmpUtilOidCpyFree(void)
ret = SnmpUtilOidCpy(NULL, &src);
ok(!ret, "SnmpUtilOidCpy succeeded\n");
}
memset(&dst, 0, sizeof(AsnObjectIdentifier));
ret = SnmpUtilOidCpy(&dst, &src);
......@@ -213,7 +221,33 @@ static void test_SnmpUtilOidCpyFree(void)
ok(src.idLength == dst.idLength, "SnmpUtilOidCpy failed\n");
ok(!memcmp(src.ids, dst.ids, dst.idLength * sizeof(UINT)), "SnmpUtilOidCpy failed\n");
/* These crashes under win98 */
if(0)
{
ret = SnmpUtilOidCpy(NULL, NULL);
ok(!ret, "SnmpUtilOidCpy succeeded\n");
memset(&dst, 1, sizeof(AsnObjectIdentifier));
ret = SnmpUtilOidCpy(&dst, NULL);
ok(ret, "SnmpUtilOidCpy failed\n");
ok(dst.idLength == 0, "SnmpUtilOidCpy failed\n");
ok(dst.ids == NULL, "SnmpUtilOidCpy failed\n");
ret = SnmpUtilOidCpy(NULL, &src);
ok(!ret, "SnmpUtilOidCpy succeeded\n");
}
memset(&dst, 0, sizeof(AsnObjectIdentifier));
ret = SnmpUtilOidCpy(&dst, &src);
ok(ret, "SnmpUtilOidCpy failed\n");
ok(src.idLength == dst.idLength, "SnmpUtilOidCpy failed\n");
ok(!memcmp(src.ids, dst.ids, dst.idLength * sizeof(UINT)), "SnmpUtilOidCpy failed\n");
/* This crashes under win98 */
if(0)
{
SnmpUtilOidFree(NULL);
}
SnmpUtilOidFree(&dst);
ok(dst.idLength == 0, "SnmpUtilOidFree failed\n");
ok(dst.ids == NULL, "SnmpUtilOidFree failed\n");
......@@ -292,6 +326,9 @@ static void test_SnmpUtilOidNCmp(void)
static AsnObjectIdentifier oid1 = { 4, ids1 };
static AsnObjectIdentifier oid2 = { 4, ids2 };
/* This crashes under win98 */
if(0)
{
ret = SnmpUtilOidNCmp(NULL, NULL, 0);
ok(!ret, "SnmpUtilOidNCmp succeeded\n");
......@@ -309,6 +346,7 @@ static void test_SnmpUtilOidNCmp(void)
ret = SnmpUtilOidNCmp(NULL, &oid2, 1);
ok(!ret, "SnmpUtilOidNCmp succeeded\n");
}
ret = SnmpUtilOidNCmp(&oid1, &oid1, 0);
ok(!ret, "SnmpUtilOidNCmp failed\n");
......@@ -379,6 +417,9 @@ static void test_SnmpUtilOidAppend(void)
oid1.idLength = 3;
oid1.ids = ids1;
/* This crashes under win98 */
if(0)
{
ret = SnmpUtilOidAppend(NULL, NULL);
ok(!ret, "SnmpUtilOidAppend succeeded\n");
......@@ -387,6 +428,7 @@ static void test_SnmpUtilOidAppend(void)
ret = SnmpUtilOidAppend(NULL, &oid2);
ok(!ret, "SnmpUtilOidAppend succeeded\n");
}
ret = SnmpUtilOidAppend(&oid1, &oid2);
ok(ret, "SnmpUtilOidAppend failed\n");
......@@ -403,6 +445,9 @@ static void test_SnmpUtilVarBindCpyFree(void)
static UINT ids[] = { 1, 3, 6, 1, 4, 1, 311 };
static SnmpVarBind dst, src = { { 7, ids }, { ASN_INTEGER, { 1 } } };
/* This crashes under win98 */
if(0)
{
ret = SnmpUtilVarBindCpy(NULL, NULL);
ok(!ret, "SnmpUtilVarBindCpy succeeded\n");
......@@ -416,6 +461,7 @@ static void test_SnmpUtilVarBindCpyFree(void)
ret = SnmpUtilVarBindCpy(NULL, &src);
ok(!ret, "SnmpUtilVarBindCpy succeeded\n");
}
memset(&dst, 0, sizeof(SnmpVarBind));
ret = SnmpUtilVarBindCpy(&dst, &src);
......@@ -426,7 +472,11 @@ static void test_SnmpUtilVarBindCpyFree(void)
ok(!memcmp(&src.value, &dst.value, sizeof(AsnObjectSyntax)),
"SnmpUtilVarBindCpy failed\n");
/* This crashes under win98 */
if(0)
{
SnmpUtilVarBindFree(NULL);
}
SnmpUtilVarBindFree(&dst);
ok(dst.name.idLength == 0, "SnmpUtilVarBindFree failed\n");
ok(dst.name.ids == NULL, "SnmpUtilVarBindFree failed\n");
......@@ -449,11 +499,15 @@ static void test_SnmpUtilVarBindListCpyFree(void)
ok(!ret, "SnmpUtilVarBindListCpy succeeded\n");
}
/* This crashes under win98 */
if(0)
{
memset(&dst_list, 0xff, sizeof(SnmpVarBindList));
ret = SnmpUtilVarBindListCpy(&dst_list, NULL);
ok(ret, "SnmpUtilVarBindListCpy failed\n");
ok(dst_list.list == NULL, "SnmpUtilVarBindListCpy failed\n");
ok(dst_list.len == 0, "SnmpUtilVarBindListCpy failed\n");
}
ret = SnmpUtilVarBindListCpy(&dst_list, &src_list);
ok(ret, "SnmpUtilVarBindListCpy failed\n");
......
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