2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Replace t_assert() with Assert().

Also use this assertions for Expects(), Ensures() and Unexpected().
This commit is contained in:
John Preston
2017-08-17 12:06:26 +03:00
parent b3da99c302
commit 25ffaaaa2d
107 changed files with 492 additions and 435 deletions

View File

@@ -345,7 +345,7 @@ void adjustColor(style::color color, float64 hue, float64 saturation) {
}
void adjustColorsUsingBackground(const QImage &img) {
t_assert(img.format() == QImage::Format_ARGB32_Premultiplied);
Assert(img.format() == QImage::Format_ARGB32_Premultiplied);
uint64 components[3] = { 0 };
uint64 componentsScroll[3] = { 0 };
@@ -430,7 +430,7 @@ void ChatBackground::setImage(int32 id, QImage &&image) {
Local::writeBackground(_id, (_id == kDefaultBackground || _id == kInitialBackground) ? QImage() : image);
setPreparedImage(prepareBackgroundImage(std::move(image)));
}
t_assert(!_pixmap.isNull() && !_pixmapForTiled.isNull());
Assert(!_pixmap.isNull() && !_pixmapForTiled.isNull());
notify(BackgroundUpdate(BackgroundUpdate::Type::New, _tile));
if (resetPalette) {
notify(BackgroundUpdate(BackgroundUpdate::Type::TestingTheme, _tile), true);
@@ -474,7 +474,7 @@ void ChatBackground::setPreparedImage(QImage &&image) {
auto width = image.width();
auto height = image.height();
t_assert(width > 0 && height > 0);
Assert(width > 0 && height > 0);
auto isSmallForTiled = (width < kMinimumTiledSize || height < kMinimumTiledSize);
if (isSmallForTiled) {
auto repeatTimesX = qCeil(kMinimumTiledSize / float64(width));