Closed Bug 1314497 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(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)
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 nnethercote@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b4e3d21a447d (part 1) - Convert intl/lwbrk/tests/TestLineBreak.cpp to a gtest. r=emk. https://hg.mozilla.org/integration/mozilla-inbound/rev/50d2cc0d4cbd (part 2) - Reformat intl/lwbrk/tests/TestLineBreak.cpp.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: