Bug 154925 - Add unit tests for WTF::OptionSet
Summary: Add unit tests for WTF::OptionSet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks: 154941
  Show dependency treegraph
 
Reported: 2016-03-02 11:13 PST by Daniel Bates
Modified: 2016-03-03 15:49 PST (History)
5 users (show)

See Also:


Attachments
Unit tests (9.40 KB, patch)
2016-03-02 11:20 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Unit tests (10.39 KB, patch)
2016-03-02 12:08 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and Unit tests (11.65 KB, patch)
2016-03-02 17:06 PST, Daniel Bates
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2016-03-02 11:13:22 PST
Although the implementation of WTF::OptionSet is straightforward we should add unit tests to ensure that we do not regress its functionality.
Comment 1 Daniel Bates 2016-03-02 11:20:07 PST
Created attachment 272666 [details]
Unit tests
Comment 2 Daniel Bates 2016-03-02 11:21:18 PST
For completeness, WTF::OptionSet was added in the patch for bug #154733, <http://trac.webkit.org/changeset/197191>.
Comment 3 Daniel Bates 2016-03-02 12:08:50 PST
Created attachment 272671 [details]
Unit tests

Add OptionSet to the CMake list of WTF headers.
Comment 4 Daniel Bates 2016-03-02 17:06:40 PST
Created attachment 272707 [details]
Patch and Unit tests

Update patch to include a convenience constructor for OptionSet that takes a std::initializer_list. The code for this constructor was written by Anders Carlsson.
Comment 5 Darin Adler 2016-03-03 09:50:21 PST
Comment on attachment 272707 [details]
Patch and Unit tests

View in context: https://bugs.webkit.org/attachment.cgi?id=272707&action=review

> Source/WTF/wtf/OptionSet.h:57
> +        : m_storage(0)

Why not initialize m_storage where it’s defined rather than in the constructors?
Comment 6 Daniel Bates 2016-03-03 15:22:47 PST
(In reply to comment #5)
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=272707&action=review
> 
> > Source/WTF/wtf/OptionSet.h:57
> > +        : m_storage(0)
> 
> Why not initialize m_storage where it’s defined rather than in the
> constructors?

Will initialize m_storage where it is defined before landing.
Comment 7 Radar WebKit Bug Importer 2016-03-03 15:23:37 PST
<rdar://problem/24964211>
Comment 8 Daniel Bates 2016-03-03 15:49:16 PST
Committed r197523: <http://trac.webkit.org/changeset/197523>