MCPcopy Create free account
hub / github.com/nodejs/node / runIntegerTestCases

Function runIntegerTestCases

deps/v8/test/mjsunit/harmony/dataview-accessors.js:110–192  ·  view source on GitHub ↗
(isTestingGet, array, start, length)

Source from the content-addressed store, hash-verified

108}
109
110function runIntegerTestCases(isTestingGet, array, start, length) {
111 createDataView(array, 0, true, start, length);
112
113 test(isTestingGet, "Int8", 0, 0);
114 test(isTestingGet, "Int8", undefined, 0);
115 test(isTestingGet, "Int8", 8, -128);
116 test(isTestingGet, "Int8", 15, -1);
117 test(isTestingGet, "Int8", 1e12, undefined);
118
119 test(isTestingGet, "Uint8", 0, 0);
120 test(isTestingGet, "Uint8", undefined, 0);
121 test(isTestingGet, "Uint8", 8, 128);
122 test(isTestingGet, "Uint8", 15, 255);
123 test(isTestingGet, "Uint8", 1e12, undefined);
124
125 // Little endian.
126 test(isTestingGet, "Int16", 0, 256, true);
127 test(isTestingGet, "Int16", undefined, 256, true);
128 test(isTestingGet, "Int16", 5, 26213, true);
129 test(isTestingGet, "Int16", 9, -32127, true);
130 test(isTestingGet, "Int16", 14, -2, true);
131 test(isTestingGet, "Int16", 1e12, undefined, true);
132
133 // Big endian.
134 test(isTestingGet, "Int16", 0, 1);
135 test(isTestingGet, "Int16", undefined, 1);
136 test(isTestingGet, "Int16", 5, 25958);
137 test(isTestingGet, "Int16", 9, -32382);
138 test(isTestingGet, "Int16", 14, -257);
139 test(isTestingGet, "Int16", 1e12, undefined);
140
141 // Little endian.
142 test(isTestingGet, "Uint16", 0, 256, true);
143 test(isTestingGet, "Uint16", undefined, 256, true);
144 test(isTestingGet, "Uint16", 5, 26213, true);
145 test(isTestingGet, "Uint16", 9, 33409, true);
146 test(isTestingGet, "Uint16", 14, 65534, true);
147 test(isTestingGet, "Uint16", 1e12, undefined, true);
148
149 // Big endian.
150 test(isTestingGet, "Uint16", 0, 1);
151 test(isTestingGet, "Uint16", undefined, 1);
152 test(isTestingGet, "Uint16", 5, 25958);
153 test(isTestingGet, "Uint16", 9, 33154);
154 test(isTestingGet, "Uint16", 14, 65279);
155 test(isTestingGet, "Uint16", 1e12, undefined);
156
157 // Little endian.
158 test(isTestingGet, "Int32", 0, 50462976, true);
159 test(isTestingGet, "Int32", undefined, 50462976, true);
160 test(isTestingGet, "Int32", 3, 1717920771, true);
161 test(isTestingGet, "Int32", 6, -2122291354, true);
162 test(isTestingGet, "Int32", 9, -58490239, true);
163 test(isTestingGet, "Int32", 12,-66052, true);
164 test(isTestingGet, "Int32", 1e12, undefined, true);
165
166 // Big endian.
167 test(isTestingGet, "Int32", 0, 66051);

Callers 2

TestGettersFunction · 0.85
TestSettersFunction · 0.85

Calls 2

createDataViewFunction · 0.70
testFunction · 0.70

Tested by

no test coverage detected