Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Issue 832583002: Mojo JS Bindings: added unit tests for int/uint values (Closed)

Created:
5 years, 11 months ago by hansmuller
Modified:
5 years, 11 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, darin (slow to review), mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Mojo JS Bindings: added unit tests for int/uint values Just a pair of tests for all of the Mojo integer types. BUG= R=abarth@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/237972f8e68244b2685d237cf70e750bed73dd2e

Patch Set 1 #

Patch Set 2 : Sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -0 lines) Patch
M mojo/public/interfaces/bindings/tests/test_structs.mojom View 1 chunk +92 lines, -0 lines 0 comments Download
M mojo/public/js/struct_unittests.js View 2 chunks +44 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (4 generated)
hansmuller1
If you have a chance, PTAL.
5 years, 11 months ago (2014-12-30 00:52:30 UTC) #3
abarth-chromium
lgtm
5 years, 11 months ago (2014-12-30 08:35:54 UTC) #5
hansmuller
Committed patchset #2 (id:20001) manually as 237972f8e68244b2685d237cf70e750bed73dd2e (presubmit successful).
5 years, 11 months ago (2014-12-30 15:51:02 UTC) #6
dcheng
5 years, 11 months ago (2014-12-30 19:10:15 UTC) #8
Message was sent while issue was closed.
MSVC is unhappy with this patch:

e:\b\build\slave\win\build\src\out\release\gen\mojo\public\interfaces\bindings\tests\test_structs.mojom.cc(1437)
: error C2220: warning treated as error - no 'object' file generated
e:\b\build\slave\win\build\src\out\release\gen\mojo\public\interfaces\bindings\tests\test_structs.mojom.cc(1437)
: warning C4146: unary minus operator applied to unsigned type, result still
unsigned

The problematic line is:
const int32_t IntegerNumberValues::V10 = -2147483648;

Per http://msdn.microsoft.com/en-us/library/4kh09110.aspx, the reason for this
is:

Practically, this occurs when the programmer is trying to express the minimum
integer value, which is -2147483648. This value cannot be written as -2147483648
because the expression is processed in two stages:
1. The number 2147483648 is evaluated. Because it is greater than the maximum
integer value of 2147483647, the type of 2147483648 is not int, but unsigned
int.
2. Unary minus is applied to the value, with an unsigned result, which also
happens to be 2147483648.

Yay...

Powered by Google App Engine
This is Rietveld 408576698