/external/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/ |
D | DurationTest.cs | 45 … Assert.AreEqual(TimeSpan.FromMilliseconds(1), new Duration { Nanos = 1000000 }.ToTimeSpan()); in ToTimeSpan() 46 … Assert.AreEqual(TimeSpan.FromMilliseconds(-1), new Duration { Nanos = -1000000 }.ToTimeSpan()); in ToTimeSpan() 47 Assert.AreEqual(TimeSpan.FromTicks(1), new Duration { Nanos = 100 }.ToTimeSpan()); in ToTimeSpan() 48 Assert.AreEqual(TimeSpan.FromTicks(-1), new Duration { Nanos = -100 }.ToTimeSpan()); in ToTimeSpan() 51 Assert.AreEqual(TimeSpan.FromTicks(2), new Duration { Nanos = 250 }.ToTimeSpan()); in ToTimeSpan() 52 Assert.AreEqual(TimeSpan.FromTicks(-2), new Duration { Nanos = -250 }.ToTimeSpan()); in ToTimeSpan() 58 Assert.AreEqual(new Duration { Seconds = 2, Nanos = 100000000 }, in Addition() 59 … new Duration { Seconds = 1, Nanos = 600000000 } + new Duration { Nanos = 500000000 }); in Addition() 60 Assert.AreEqual(new Duration { Seconds = -2, Nanos = -100000000 }, in Addition() 61 … new Duration { Seconds = -1, Nanos = -600000000 } + new Duration { Nanos = -500000000 }); in Addition() [all …]
|
D | TimestampTest.cs | 46 AssertRoundtrip(new Timestamp { Seconds = 253402300799, Nanos = 999999900 }, utcMax); in FromAndToDateTime() 48 …AssertRoundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKin… in FromAndToDateTime() 49 …AssertRoundtrip(new Timestamp { Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, … in FromAndToDateTime() 57 … var t1 = new Timestamp { Seconds = 1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; in ToDateTimeTruncation() 60 … var t2 = new Timestamp { Seconds = -1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; in ToDateTimeTruncation() 71 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_OutOfRange() 83 var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in ToDateTime_ValidBoundaries() 97 Timestamp t1 = new Timestamp { Seconds = 10000, Nanos = 5000 }; in Arithmetic() 98 Timestamp t2 = new Timestamp { Seconds = 8000, Nanos = 10000 }; in Arithmetic() 99 …Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 … in Arithmetic() [all …]
|
/external/golang-protobuf/ptypes/ |
D | duration_test.go | 55 {&durpb.Duration{Seconds: 0, Nanos: 0}, true, true, 0}, 57 {&durpb.Duration{Seconds: 100, Nanos: 0}, true, true, 100 * time.Second}, 58 {&durpb.Duration{Seconds: -100, Nanos: 0}, true, true, -100 * time.Second}, 59 {&durpb.Duration{Seconds: 100, Nanos: 987}, true, true, 100*time.Second + 987}, 60 {&durpb.Duration{Seconds: -100, Nanos: -987}, true, true, -(100*time.Second + 987)}, 62 …{&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, tru… 64 …{&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, tru… 66 {&durpb.Duration{Seconds: -100, Nanos: 987}, false, false, 0}, 67 {&durpb.Duration{Seconds: 100, Nanos: -987}, false, false, 0}, 68 {&durpb.Duration{Seconds: math.MinInt64, Nanos: 0}, false, false, 0}, [all …]
|
D | timestamp_test.go | 49 {&tspb.Timestamp{Seconds: 0, Nanos: 0}, true, utcDate(1970, 1, 1)}, 51 {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: math.MinInt32}, false, 54 {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: 0}, false, time.Unix(math.MinInt64, 0).UTC()}, 56 {&tspb.Timestamp{Seconds: minValidSeconds, Nanos: 0}, true, utcDate(1, 1, 1)}, 59 {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: math.MaxInt32}, false, 62 {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: 1e9 - 1}, false, 65 {&tspb.Timestamp{Seconds: maxValidSeconds - 1, Nanos: 1e9 - 1}, true, 68 {&tspb.Timestamp{Seconds: maxValidSeconds, Nanos: 0}, false, time.Unix(maxValidSeconds, 0).UTC()}, 70 {&tspb.Timestamp{Seconds: -281836800, Nanos: 0}, true, utcDate(1961, 1, 26)}, 72 {&tspb.Timestamp{Seconds: 1296000000, Nanos: 0}, true, utcDate(2011, 1, 26)}, [all …]
|
D | duration.go | 63 if d.Nanos <= -1e9 || d.Nanos >= 1e9 { 67 if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { 84 if p.Nanos != 0 { 85 d += time.Duration(p.Nanos) * time.Nanosecond 86 if (d < 0) != (p.Nanos < 0) { 100 Nanos: int32(nanos),
|
D | timestamp.go | 73 if ts.Nanos < 0 || ts.Nanos >= 1e9 { 97 t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() 116 Nanos: int32(t.Nanosecond()),
|
/external/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/ |
D | Duration.cs | 137 public int Nanos { property in Google.Protobuf.WellKnownTypes.Duration 156 if (Nanos != other.Nanos) return false; in Equals() 163 if (Nanos != 0) hash ^= Nanos.GetHashCode(); in GetHashCode() 176 if (Nanos != 0) { in WriteTo() 178 output.WriteInt32(Nanos); in WriteTo() 187 if (Nanos != 0) { in CalculateSize() 188 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); in CalculateSize() 200 if (other.Nanos != 0) { in MergeFrom() 201 Nanos = other.Nanos; in MergeFrom() 217 Nanos = input.ReadInt32(); in MergeFrom()
|
D | Timestamp.cs | 148 public int Nanos { property in Google.Protobuf.WellKnownTypes.Timestamp 167 if (Nanos != other.Nanos) return false; in Equals() 174 if (Nanos != 0) hash ^= Nanos.GetHashCode(); in GetHashCode() 187 if (Nanos != 0) { in WriteTo() 189 output.WriteInt32(Nanos); in WriteTo() 198 if (Nanos != 0) { in CalculateSize() 199 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); in CalculateSize() 211 if (other.Nanos != 0) { in MergeFrom() 212 Nanos = other.Nanos; in MergeFrom() 228 Nanos = input.ReadInt32(); in MergeFrom()
|
D | TimestampPartial.cs | 66 return Duration.Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -() 82 return Normalize(lhs.Seconds + rhs.Seconds, lhs.Nanos + rhs.Nanos); in operator +() 98 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -() 116 if (!IsNormalized(Seconds, Nanos)) in ToDateTime() 120 return UnixEpoch.AddSeconds(Seconds).AddTicks(Nanos / Duration.NanosecondsPerTick); in ToDateTime() 155 …return new Timestamp { Seconds = secondsSinceBclEpoch - BclSecondsAtUnixEpoch, Nanos = nanoseconds… in FromDateTime() 184 return new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in Normalize() 238 return ToJson(Seconds, Nanos, true); in ToDiagnosticString()
|
D | DurationPartial.cs | 89 if (!IsNormalized(Seconds, Nanos)) in ToTimeSpan() 93 long ticks = Seconds * TimeSpan.TicksPerSecond + Nanos / NanosecondsPerTick; in ToTimeSpan() 110 return new Duration { Seconds = seconds, Nanos = nanos }; in FromTimeSpan() 124 return Normalize(-value.Seconds, -value.Nanos); in operator -() 140 return Normalize(lhs.Seconds + rhs.Seconds, lhs.Nanos + rhs.Nanos); in operator +() 156 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); in operator -() 182 return new Duration { Seconds = seconds, Nanos = nanoseconds }; in Normalize() 241 return ToJson(Seconds, Nanos, true); in ToDiagnosticString()
|
/external/syzkaller/vendor/github.com/golang/protobuf/ptypes/ |
D | duration.go | 63 if d.Nanos <= -1e9 || d.Nanos >= 1e9 { 67 if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { 84 if p.Nanos != 0 { 85 d += time.Duration(p.Nanos) 86 if (d < 0) != (p.Nanos < 0) { 100 Nanos: int32(nanos),
|
D | timestamp.go | 73 if ts.Nanos < 0 || ts.Nanos >= 1e9 { 97 t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() 118 Nanos: nanos,
|
/external/golang-protobuf/jsonpb/ |
D | jsonpb_test.go | 477 …{"Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 3, Nanos: 1e6}}, `{"dur":"3.0… 478 …sion", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 100000000, Nanos: 1}}, `{"dur":"100… 479 …{"negative Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: -123, Nanos: -456}},… 493 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 21e6}}, `{"ts":"… 494 …{"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 0}}, `{"ts":"201… 552 {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: 0}}, false}, 553 {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: -1, Nanos: 0}}, false}, 554 {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: -1}}, true}, 555 {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: -1, Nanos: 1}}, true}, 556 {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: 1000000000}}, true}, [all …]
|
/external/golang-protobuf/ptypes/duration/ |
D | duration.pb.go | 94 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member 136 return m.Nanos
|
/external/golang-protobuf/ptypes/timestamp/ |
D | timestamp.pb.go | 112 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member 154 return m.Nanos
|
/external/syzkaller/vendor/github.com/golang/protobuf/ptypes/duration/ |
D | duration.pb.go | 92 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member 132 return m.Nanos
|
/external/syzkaller/vendor/github.com/golang/protobuf/ptypes/timestamp/ |
D | timestamp.pb.go | 108 Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` member 148 return m.Nanos
|
/external/protobuf/csharp/src/Google.Protobuf.Test/ |
D | JsonFormatterTest.cs | 334 Assert.AreEqual(WrapInQuotes(expected), new Timestamp { Nanos = nanos }.ToString()); in TimestampStandalone() 354 var timestamp = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; in TimestampStandalone_NonNormalized() 391 … var json = JsonFormatter.Default.Format(new Duration { Seconds = seconds, Nanos = nanoseconds }); in DurationStandalone() 400 var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; in DurationStandalone_NonNormalized()
|
/external/protobuf/csharp/src/Google.Protobuf/ |
D | JsonParser.cs | 841 timestamp += new Duration { Nanos = nanosToAdd, Seconds = secondsToAdd }; in MergeTimestamp() 850 … message.Descriptor.Fields[Timestamp.NanosFieldNumber].Accessor.SetValue(message, timestamp.Nanos); in MergeTimestamp()
|