Commit 66c81ad8 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Prefer const char* over unneeded std::string in a few tests.

Removes 69 exit time destructors. Since it's test-only this isn't
very important, but since it also simplifies the code and needs fewer
string conversions at runtime, might as well do it.

Bug: 101600
Change-Id: I7474cbcf77fdbb35f350dbfdfee1ed597cadbe50
Reviewed-on: https://chromium-review.googlesource.com/1258301
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596253}
parent c034b8d8
......@@ -5,12 +5,11 @@
#include "third_party/blink/renderer/platform/fonts/orientation_iterator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <string>
namespace blink {
struct OrientationTestRun {
std::string text;
const char* const text;
OrientationIterator::RenderOrientation code;
};
......@@ -30,7 +29,7 @@ class OrientationIteratorTest : public testing::Test {
String text(g_empty_string16_bit);
Vector<OrientationExpectedRun> expect;
for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str()));
text.append(String::FromUTF8(run.text));
expect.push_back(OrientationExpectedRun(text.length(), run.code));
}
OrientationIterator orientation_iterator(text.Characters16(), text.length(),
......
......@@ -4,7 +4,6 @@
#include "third_party/blink/renderer/platform/fonts/script_run_iterator.h"
#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
......@@ -13,7 +12,7 @@
namespace blink {
struct ScriptTestRun {
std::string text;
const char* const text;
UScriptCode code;
};
......@@ -290,7 +289,7 @@ class ScriptRunIteratorTest : public testing::Test {
String text(g_empty_string16_bit);
Vector<ScriptExpectedRun> expect;
for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str()));
text.append(String::FromUTF8(run.text));
expect.push_back(ScriptExpectedRun(text.length(), run.code));
}
ScriptRunIterator script_run_iterator(text.Characters16(), text.length());
......
......@@ -5,12 +5,11 @@
#include "third_party/blink/renderer/platform/fonts/small_caps_iterator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <string>
namespace blink {
struct SmallCapsTestRun {
std::string text;
const char* const text;
SmallCapsIterator::SmallCapsBehavior code;
};
......@@ -30,7 +29,7 @@ class SmallCapsIteratorTest : public testing::Test {
String text(g_empty_string16_bit);
Vector<SmallCapsExpectedRun> expect;
for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str()));
text.append(String::FromUTF8(run.text));
expect.push_back(SmallCapsExpectedRun(text.length(), run.code));
}
SmallCapsIterator small_caps_iterator(text.Characters16(), text.length());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment