blob: caf540c434b1a421584f528330116e5b9495a452 [file] [log] [blame]
Stephane Barbarieec0919b2018-09-05 14:14:29 -04001package model
2
3import (
4 "testing"
5 "github.com/opencord/voltha-go/protos/voltha"
6 "reflect"
7)
8
9func Test_Utils_Clone(t *testing.T) {
10 a := &voltha.Device{
11 Id: "abcde",
12 FirmwareVersion: "someversion",
13 }
14 b:= &voltha.Device{}
15 Clone(reflect.ValueOf(a).Interface(), b)
16 t.Logf("A: %+v, B: %+v", a, b)
17 b.Id = "12345"
18 t.Logf("A: %+v, B: %+v", a, b)
19
20 var c *voltha.Device
21 c = Clone2(a).(*voltha.Device)
22 t.Logf("A: %+v, C: %+v", a, c)
23 c.Id = "12345"
24 t.Logf("A: %+v, C: %+v", a, c)
25}