incercare gob

This commit is contained in:
Radu Ioan Fericean
2012-02-02 14:54:52 +02:00
parent fbab09d804
commit 0967ce7b46
2 changed files with 21 additions and 2 deletions

View File

@@ -228,7 +228,7 @@ func TestEnclosingMargin(t *testing.T){
}
}
/*func TestOutsideMargin(t *testing.T){
func TestOutsideMargin(t *testing.T){
i := &Interval{WeekDays: []time.Weekday{time.Monday}}
t1 := time.Date(2012, time.February, 5, 17, 45, 0, 0, time.UTC)
t2 := time.Date(2012, time.February, 5, 18, 10, 0, 0, time.UTC)
@@ -237,7 +237,7 @@ func TestEnclosingMargin(t *testing.T){
if result != nil {
t.Error("Interval not split correctly")
}
}*/
}
func BenchmarkIntervalFull(b *testing.B) {
i := &Interval{Month: time.February, MonthDay: 1, WeekDays: []time.Weekday{time.Wednesday, time.Thursday}, StartHour: "14:30", EndHour: "15:00"}

View File

@@ -62,6 +62,25 @@ func (c *Customer) decodeValue(v []byte) {
}
}
/*
func (c *Customer) encodeValue() (result bytes.Buffer) {
enc := gob.NewEncoder(&result)
err:= enc.Encode(c.ActivationPeriods)
if err != nil {
log.Print("Cannot encode intervals: ", err)
}
return result
}
func (c *Customer) decodeValue(v bytes.Buffer) {
dec := gob.NewDecoder(&v)
err := dec.Decode(&c.ActivationPeriods)
if err != nil {
log.Print("Cannot decode intervals: ", err)
}
}
*/
/*
A unit in which a call will be split that has a specific price related interval attached to it.
*/