mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, an extensible empty enum may be useful because all
values are valid for it.
BUG=619693
TEST=existing tests & new bindings conformance test
Review-Url: https://codereview.chromium.org/2741943002
Cr-Commit-Position: refs/heads/master@{#456596}
Committed: https://chromium.googlesource.com/chromium/src/+/497ec8da95fdb294957278ebd8dc49d5f88b980f
Hi yzshen@, PTAL. Let me know if I can add more tests. I figured that ...
3 years, 9 months ago
(2017-03-10 07:21:06 UTC)
#4
Hi yzshen@, PTAL. Let me know if I can add more tests. I figured that most of it
is covered by existing tests.
Thanks
watk
Description was changed from ========== mojo bindings: Support enums with no values Previously it was ...
3 years, 9 months ago
(2017-03-10 07:22:14 UTC)
#5
Description was changed from
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum:
enum A {};
This CL makes it a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, all values are valid for an extensible enum.
BUG=619693
TEST=existing tests & new bindings conformance test
==========
to
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, all values are valid for an extensible enum.
BUG=619693
TEST=existing tests & new bindings conformance test
==========
watk
Description was changed from ========== mojo bindings: Support enums with no values Previously it was ...
3 years, 9 months ago
(2017-03-10 07:22:56 UTC)
#6
Description was changed from
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, all values are valid for an extensible enum.
BUG=619693
TEST=existing tests & new bindings conformance test
==========
to
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, an extensible empty enum may be useful because all
values are valid for it.
BUG=619693
TEST=existing tests & new bindings conformance test
==========
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
3 years, 9 months ago
(2017-03-10 07:26:27 UTC)
#7
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/382029)
3 years, 9 months ago
(2017-03-10 07:26:28 UTC)
#8
LGTM with one nit. Thanks! https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data File mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data (right): https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data#newcode1 mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data:1: [dist4]message_header // num_bytes nit: ...
3 years, 9 months ago
(2017-03-10 16:43:48 UTC)
#9
LGTM with one nit.
Thanks!
https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bind...
File
mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data
(right):
https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bind...
mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data:1:
[dist4]message_header // num_bytes
nit: it would be nice to have "extensible" in the file name. Because by default
empty enum rejects any value.
[optional] maybe we could add a test for the non-extensiable empty enum as well.
watk
Patchset #2 (id:20001) has been deleted
3 years, 9 months ago
(2017-03-13 00:36:24 UTC)
#10
Patchset #2 (id:20001) has been deleted
watk
Thanks! New test added and I had to special case the operator<<() implementation for empty ...
3 years, 9 months ago
(2017-03-13 00:39:32 UTC)
#11
Thanks! New test added and I had to special case the operator<<() implementation
for empty enums because MSVC doesn't like switches with no cases.
The template change was pretty trivial but I'll ask for another lgtm from you in
case I missed something.
https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bind...
File
mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data
(right):
https://codereview.chromium.org/2741943002/diff/1/mojo/public/interfaces/bind...
mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_enum_accepts_any_value.data:1:
[dist4]message_header // num_bytes
On 2017/03/10 16:43:48, yzshen1 wrote:
> nit: it would be nice to have "extensible" in the file name. Because by
default
> empty enum rejects any value.
>
> [optional] maybe we could add a test for the non-extensiable empty enum as
well.
Both done.
yzshen1
LGTM++
3 years, 9 months ago
(2017-03-13 17:44:42 UTC)
#12
LGTM++
watk
The CQ bit was checked by watk@chromium.org
3 years, 9 months ago
(2017-03-14 00:10:39 UTC)
#13
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/135942)
3 years, 9 months ago
(2017-03-14 00:25:32 UTC)
#16
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1489452038850520, "parent_rev": "f80d22fd4bcf1fc04feea4644da8df7c73f418f8", "commit_rev": "497ec8da95fdb294957278ebd8dc49d5f88b980f"}
3 years, 9 months ago
(2017-03-14 02:54:18 UTC)
#19
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1489452038850520,
"parent_rev": "f80d22fd4bcf1fc04feea4644da8df7c73f418f8", "commit_rev":
"497ec8da95fdb294957278ebd8dc49d5f88b980f"}
commit-bot: I haz the power
Description was changed from ========== mojo bindings: Support enums with no values Previously it was ...
3 years, 9 months ago
(2017-03-14 02:55:01 UTC)
#20
Message was sent while issue was closed.
Description was changed from
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, an extensible empty enum may be useful because all
values are valid for it.
BUG=619693
TEST=existing tests & new bindings conformance test
==========
to
==========
mojo bindings: Support enums with no values
Previously it was invalid to define an empty enum, i.e.:
enum A {};
Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, an extensible empty enum may be useful because all
values are valid for it.
BUG=619693
TEST=existing tests & new bindings conformance test
Review-Url: https://codereview.chromium.org/2741943002
Cr-Commit-Position: refs/heads/master@{#456596}
Committed:
https://chromium.googlesource.com/chromium/src/+/497ec8da95fdb294957278ebd8dc...
==========
commit-bot: I haz the power
Committed patchset #2 (id:40001) as https://chromium.googlesource.com/chromium/src/+/497ec8da95fdb294957278ebd8dc49d5f88b980f
3 years, 9 months ago
(2017-03-14 02:55:02 UTC)
#21
Issue 2741943002: mojo bindings: Support enums with no values
(Closed)
Created 3 years, 9 months ago by watk
Modified 3 years, 9 months ago
Reviewers: yzshen1
Base URL:
Comments: 2