Lines Matching refs:Int64

2  * @fileoverview Tests for Int64.
7 const Int64 = goog.require('protobuf.Int64');
10 describe('Int64', () => {
12 const int64 = Int64.fromBits(0, 1);
18 const int64 = Int64.getZero();
24 const int64 = Int64.getMaxValue();
25 expect(int64).toEqual(Int64.fromBits(0xFFFFFFFF, 0x7FFFFFFF));
30 const int64 = Int64.getMinValue();
31 expect(int64).toEqual(Int64.fromBits(0, 0x80000000));
36 const int64 = Int64.fromInt(1);
41 const int64 = Int64.fromInt(-1);
48 const int64 = Int64.fromInt(1);
53 const int64 = Int64.fromInt(-1);
58 const int64 = Int64.fromNumber(Number.MAX_SAFE_INTEGER);
65 const int64 = Int64.fromNumber(Number.MIN_SAFE_INTEGER);
70 const int64 = Int64.fromInt(1);
76 const int64 = Int64.fromLong(Long.fromInt(1));
84 expect(() => Int64.fromNumber(Number.MAX_SAFE_INTEGER + 1).asNumber())
89 expect(() => Int64.fromInt(Number.MAX_SAFE_INTEGER)).toThrow();
93 expect(() => Int64.fromInt(1.5)).toThrow();
145 const signed = Int64.fromDecimalString(decimals.signed);
148 const unsigned = Int64.fromDecimalString(decimals.unsigned);
156 expect(int64ToHex(Int64.fromHexString(hex))).toEqual(hex);
158 expect(int64ToHex(Int64.fromHexString('-0x1')))
165 expect(() => Int64.fromDecimalString('')).toThrow();
169 expect(() => Int64.fromDecimalString('1.5')).toThrow();
173 expect(() => Int64.fromDecimalString('0xa')).toThrow();
178 const low = Int64.fromInt(1);
179 const high = Int64.getMaxValue();
180 expect(low.equals(Int64.fromInt(1))).toEqual(true);
182 expect(high.equals(Int64.getMaxValue())).toEqual(true);
186 expect(Int64.fromInt(1).hashCode()).toEqual(Int64.fromInt(1).hashCode());
187 expect(Int64.fromInt(1).hashCode())
188 .not.toEqual(Int64.fromInt(2).hashCode());
194 * @return {!Int64}
199 return Int64.fromBits(parseInt(low, 16), parseInt(high, 16));
203 * @param {!Int64} int64