mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-24 16:27:42 +01:00
Add a test in XStringW.
This commit is contained in:
parent
97d1d23eb0
commit
da5dc56504
@ -183,7 +183,8 @@ void XObjArrayNC<TYPE>::CheckSize(xsize nNewSize, xsize nGrowBy)
|
||||
nNewSize += nGrowBy + 1;
|
||||
_Data = (XObjArrayEntry<TYPE> *)realloc((void *)_Data, sizeof(XObjArrayEntry<TYPE>) * nNewSize, sizeof(XObjArrayEntry<TYPE>) * m_allocatedSize);
|
||||
if ( !_Data ) {
|
||||
XObjArray_DBG("XObjArrayNC<TYPE>::CheckSize(nNewSize=%llu, nGrowBy=%llu) : Xrealloc(%llu, %llu, %" PRIuPTR ") returned NULL. System halted\n", nNewSize, nGrowBy, m_allocatedSize, sizeof(XObjArrayEntry<TYPE>) * nNewSize, (uintptr_t)_Data);
|
||||
DebugLog(2, "XObjArrayNC<TYPE>::CheckSize(nNewSize=%llu, nGrowBy=%llu) : Xrealloc(%llu, %llu, %" PRIuPTR ") returned NULL. System halted\n", nNewSize, nGrowBy, m_allocatedSize, sizeof(XObjArrayEntry<TYPE>) * nNewSize, (uintptr_t)_Data);
|
||||
panic();
|
||||
}
|
||||
// memset(&_Data[m_allocatedSize], 0, (nNewSize-m_allocatedSize) * sizeof(XObjArrayEntry<TYPE>));
|
||||
m_allocatedSize = nNewSize;
|
||||
|
@ -162,6 +162,16 @@ int XStringW_tests()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
XStringW utf16;
|
||||
utf16.takeValueFrom(L"Выход из подменю, обновление главного меню\n");
|
||||
for ( size_t i = 0 ; i < utf16.length() ; i++ ) {
|
||||
if ( utf16[i] != utf16.wc_str()[i] ) {
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XStringW CommonName(L"EFI\\CLOVER\\misc\\screenshot");
|
||||
// for (UINTN Index = 0; Index < 20; Index++) {
|
||||
// XStringW Name = CommonName + SPrintf("%lld", Index) + L".png";
|
||||
|
Loading…
Reference in New Issue
Block a user