mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:47:34 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
TEST_CASE(test_fontdatabase_get_by_name)
|
||||
{
|
||||
char const* name = "Liza 10 400 0";
|
||||
auto name = "Liza 10 400 0"sv;
|
||||
auto& font_database = Gfx::FontDatabase::the();
|
||||
EXPECT(!font_database.get_by_name(name)->name().is_null());
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ TEST_CASE(test_set_name)
|
|||
u8 glyph_width = 1;
|
||||
auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256);
|
||||
|
||||
char const* name = "my newly created font";
|
||||
auto name = "my newly created font"sv;
|
||||
font->set_name(name);
|
||||
|
||||
EXPECT(!font->name().is_null());
|
||||
|
@ -68,7 +68,7 @@ TEST_CASE(test_set_family)
|
|||
u8 glyph_width = 1;
|
||||
auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256);
|
||||
|
||||
char const* family = "my newly created font family";
|
||||
auto family = "my newly created font family"sv;
|
||||
font->set_family(family);
|
||||
|
||||
EXPECT(!font->family().is_null());
|
||||
|
@ -105,7 +105,7 @@ TEST_CASE(test_width)
|
|||
u8 glyph_width = 1;
|
||||
auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256);
|
||||
|
||||
EXPECT(font->width("A") == glyph_width);
|
||||
EXPECT(font->width("A"sv) == glyph_width);
|
||||
}
|
||||
|
||||
TEST_CASE(test_glyph_or_emoji_width)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
TEST_CASE(test_bmp)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgba32-1.bmp").release_value();
|
||||
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgba32-1.bmp"sv).release_value();
|
||||
auto bmp = Gfx::BMPImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(bmp.frame_count());
|
||||
|
||||
|
@ -37,7 +37,7 @@ TEST_CASE(test_bmp)
|
|||
|
||||
TEST_CASE(test_gif)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/graphics/download-animation.gif").release_value();
|
||||
auto file = Core::MappedFile::map("/res/graphics/download-animation.gif"sv).release_value();
|
||||
auto gif = Gfx::GIFImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(gif.frame_count());
|
||||
|
||||
|
@ -52,7 +52,7 @@ TEST_CASE(test_gif)
|
|||
TEST_CASE(test_ico)
|
||||
{
|
||||
// FIXME: Use an ico file
|
||||
auto file = Core::MappedFile::map("/res/graphics/buggie.png").release_value();
|
||||
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
|
||||
auto ico = Gfx::ICOImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(ico.frame_count());
|
||||
|
||||
|
@ -65,7 +65,7 @@ TEST_CASE(test_ico)
|
|||
|
||||
TEST_CASE(test_jpg)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgb24.jpg").release_value();
|
||||
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgb24.jpg"sv).release_value();
|
||||
auto jpg = Gfx::JPGImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(jpg.frame_count());
|
||||
|
||||
|
@ -79,7 +79,7 @@ TEST_CASE(test_jpg)
|
|||
|
||||
TEST_CASE(test_pbm)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/pbmsuite_files/buggie-raw.pbm").release_value();
|
||||
auto file = Core::MappedFile::map("/res/html/misc/pbmsuite_files/buggie-raw.pbm"sv).release_value();
|
||||
auto pbm = Gfx::PBMImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(pbm.frame_count());
|
||||
|
||||
|
@ -93,7 +93,7 @@ TEST_CASE(test_pbm)
|
|||
|
||||
TEST_CASE(test_pgm)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/pgmsuite_files/buggie-raw.pgm").release_value();
|
||||
auto file = Core::MappedFile::map("/res/html/misc/pgmsuite_files/buggie-raw.pgm"sv).release_value();
|
||||
auto pgm = Gfx::PGMImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(pgm.frame_count());
|
||||
|
||||
|
@ -107,7 +107,7 @@ TEST_CASE(test_pgm)
|
|||
|
||||
TEST_CASE(test_png)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/graphics/buggie.png").release_value();
|
||||
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
|
||||
auto png = Gfx::PNGImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(png.frame_count());
|
||||
|
||||
|
@ -121,7 +121,7 @@ TEST_CASE(test_png)
|
|||
|
||||
TEST_CASE(test_ppm)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/ppmsuite_files/buggie-raw.ppm").release_value();
|
||||
auto file = Core::MappedFile::map("/res/html/misc/ppmsuite_files/buggie-raw.ppm"sv).release_value();
|
||||
auto ppm = Gfx::PPMImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(ppm.frame_count());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue