Skip to content

Commit 4b12381

Browse files
belyshevdenisCopilotSergiusTheBest
authored
Add tests for USimpleString (KF-31, #72)
* implement tests for USimpleString * implement tests for USimpleString * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Remove extra .string() --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Sergey Podobry <[email protected]>
1 parent 5a120d5 commit 4b12381

File tree

3 files changed

+853
-1
lines changed

3 files changed

+853
-1
lines changed

include/kf/USimpleString.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ namespace kf
334334
return const_cast<USimpleString*>(this)->end();
335335
}
336336

337-
// Comparison
337+
// Comparison return code meaning:
338+
// Return code Description
339+
// 0: this equals str
340+
// <0: this is less than str
341+
// >0: this is greater than str
338342
inline int USimpleString::compareTo(_In_ const UNICODE_STRING& str) const
339343
{
340344
return ::RtlCompareUnicodeString(&m_str, &str, FALSE);
@@ -375,11 +379,13 @@ namespace kf
375379
return equalsIgnoreCase(str.string());
376380
}
377381

382+
// Case sensitive lexicographical comparison
378383
inline bool USimpleString::operator<(_In_ const USimpleString& another) const
379384
{
380385
return compareTo(another) < 0;
381386
}
382387

388+
// Case sensitive lexicographical comparison
383389
inline bool USimpleString::operator==(_In_ const USimpleString& another) const
384390
{
385391
return equals(another);

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ wdk_add_driver(kf-test WINVER NTDDI_WIN10 STL
5959
AutoSpinLockTest.cpp
6060
EResourceSharedLockTest.cpp
6161
RecursiveAutoSpinLockTest.cpp
62+
USimpleStringTest.cpp
6263
)
6364

6465
target_link_libraries(kf-test kf::kf kmtest::kmtest)

0 commit comments

Comments
 (0)