RESOLVED FIXED154925
Add unit tests for WTF::OptionSet
https://bugs.webkit.org/show_bug.cgi?id=154925
Summary Add unit tests for WTF::OptionSet
Daniel Bates
Reported 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.
Attachments
Unit tests (9.40 KB, patch)
2016-03-02 11:20 PST, Daniel Bates
no flags
Unit tests (10.39 KB, patch)
2016-03-02 12:08 PST, Daniel Bates
no flags
Patch and Unit tests (11.65 KB, patch)
2016-03-02 17:06 PST, Daniel Bates
darin: review+
Daniel Bates
Comment 1 2016-03-02 11:20:07 PST
Created attachment 272666 [details] Unit tests
Daniel Bates
Comment 2 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>.
Daniel Bates
Comment 3 2016-03-02 12:08:50 PST
Created attachment 272671 [details] Unit tests Add OptionSet to the CMake list of WTF headers.
Daniel Bates
Comment 4 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.
Darin Adler
Comment 5 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?
Daniel Bates
Comment 6 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.
Radar WebKit Bug Importer
Comment 7 2016-03-03 15:23:37 PST
Daniel Bates
Comment 8 2016-03-03 15:49:16 PST
Note You need to log in before you can comment on or make changes to this bug.