Skip to content

Commit d812fab

Browse files
committed
Update tests.
1 parent 3e715e1 commit d812fab

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

StringTable2Test/unittest2.cpp

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ namespace TestStringTable
159159
DESTROY_TABLE(StringTable);
160160
}
161161

162+
TEST_METHOD(TestCreateStringTableFromDelimitedString5)
163+
{
164+
PSTRING_TABLE StringTable;
165+
166+
STRING Test1 = RTL_CONSTANT_STRING("foobar;offer;bars;rams;arms;fooz;");
167+
168+
DELIMITED_TABLE(&Test1);
169+
ASSERT_SIZE(6);
170+
DESTROY_TABLE(StringTable);
171+
172+
}
173+
174+
162175
//
163176
// The following is useful when needing to test boundary conditions.
164177
//
@@ -400,7 +413,7 @@ namespace TestStringTable
400413
#define DSTFO DEFINE_STRING_TABLE_FUNCTION_OFFSET
401414

402415
STRING_TABLE_FUNCTION_OFFSET Functions[] = {
403-
DSTFO(IsPrefixOfStringInTable_x64_12, TRUE),
416+
DSTFO(IsPrefixOfStringInTable_x64_16, TRUE),
404417
//DSTFO(IsPrefixOfStringInTable_13, TRUE)
405418
};
406419

@@ -428,5 +441,50 @@ namespace TestStringTable
428441
Assert::IsTrue(Failed == 0);
429442
}
430443

444+
TEST_METHOD(TestSubsetHelper2)
445+
{
446+
ULONG Failed;
447+
ULONG Passed;
448+
BOOLEAN Success;
449+
PSTRING_ARRAY StringArray;
450+
451+
//
452+
// Change this if you want to quickly test/debug a subset of
453+
// functions and/or test inputs.
454+
//
455+
456+
STRING_TABLE_TEST_INPUT TestInputs[] = {
457+
NTFS2_TEST_INPUT(MftMirr1234567890),
458+
};
459+
460+
STRING_TABLE_FUNCTION_OFFSET Functions[] = {
461+
DSTFO(IsPrefixOfStringInTable_x64_9, TRUE),
462+
//DSTFO(IsPrefixOfStringInTable_13, TRUE)
463+
};
464+
465+
//StringArray = (PSTRING_ARRAY)&NtfsStringArray16;
466+
StringArray = (PSTRING_ARRAY)&Ntfs2StringArray16;
467+
468+
Success = Api->TestIsPrefixOfStringInTableFunctions(
469+
Rtl,
470+
Allocator,
471+
Allocator,
472+
StringArray,
473+
(PSTRING_TABLE_ANY_API)Api,
474+
sizeof(*Api),
475+
(PCSTRING_TABLE_FUNCTION_OFFSET)&Functions,
476+
ARRAYSIZE(Functions),
477+
(PCSTRING_TABLE_TEST_INPUT)&TestInputs,
478+
ARRAYSIZE(TestInputs),
479+
TRUE,
480+
TRUE,
481+
&Failed,
482+
&Passed
483+
);
484+
485+
Assert::IsTrue(Success);
486+
Assert::IsTrue(Failed == 0);
487+
}
488+
431489
};
432490
}

0 commit comments

Comments
 (0)