Closed Bug 1314497 Opened 3 years ago Closed 3 years ago

Convert intl/lwbrk/tests/TestLineBreak.cpp to a gtest


(Core :: Internationalization, defect)

Not set



Tracking Status
firefox52 --- fixed


(Reporter: njn, Assigned: njn)




(2 files)

intl/lwbrk/tests/TestLineBreak.cpp is a horrible old test that also happens to be a GeckoCppUnitTest and so its presence blocks bug 1313141. I will change it to a gtest.
This commit does the following.

- Converts the test to a gtest, including renaming the directory.

- Factors out the duplicated checking code into a separate Check() function.

- Avoids printing any output unless a failure occurs. (The gtest harness prints
  out minimal output, like the name of the current test.)

- Removes SampleWordBreakUsage(), which prints some output but doesn't actually
  test anything, and so isn't useful.
Attachment #8806575 - Flags: review?(VYV03354)
This patch makes no functional changes.
Attachment #8806576 - Flags: review?(VYV03354)
Duplicate of this bug: 1313755
Blocks: 1299187
Blocks: 1313141
No longer blocks: 1299187
Comment on attachment 8806575 [details] [diff] [review]
(part 1) - Convert intl/lwbrk/tests/TestLineBreak.cpp to a gtest

Review of attachment 8806575 [details] [diff] [review]:

r=me with the following comment resolved.

::: intl/lwbrk/gtest/TestLineBreak.cpp
@@ -314,5 @@
> -static const char wb3[] =  "ernationali";
> -static const char wb4[] =  "zation work.";
> -
> -static const char* wb[] = {wb0,wb1,wb2,wb3,wb4};
> -void SampleWordBreakUsage()

Could you leave this function (and sub-functions) intact? I'll convert them to automated tests later on.

Originally TestLineBreak.cpp was a manual test. Bug 754176 changed the file to a CppUnitTest, but the bug didn't convert this function. It's the reason why this function only output the result.
Attachment #8806575 - Flags: review?(VYV03354) → review+
Attachment #8806576 - Flags: review?(VYV03354) → review+
Blocks: 1314624
Pushed by
(part 1) - Convert intl/lwbrk/tests/TestLineBreak.cpp to a gtest. r=emk.
(part 2) - Reformat intl/lwbrk/tests/TestLineBreak.cpp.
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.