// GetSetData tests Get and Set adapter methods
GetSetData tests Get and Set adapter methods
// GetSetData tests Get and Set adapter methods
func GetSetData(adapterInfo *TestAdapterInfo) (err error) {
	if adapterInfo.SetData == nil {
		return nil
	}
	err = adapterInfo.Adapter.SetData(adapterInfo.SetData)
	if err != nil {
		return err
	}
	getPathList := make([]string, 0, len(adapterInfo.SetData))
	for path := range adapterInfo.SetData {
		getPathList = append(getPathList, path)
	}
	getData, err := adapterInfo.Adapter.GetData(getPathList)
	if err != nil {
		return err
	}
	for path, data := range getData {
		if !reflect.DeepEqual(adapterInfo.SetData[path], data) {
			return fmt.Errorf("wrong path: %s value: %v", path, data)
		}
	}
	return nil
}
func GetSetData ( adapterInfo * TestAdapterInfo ) ( err error ) { if adapterInfo . SetData == nil { return nil } err = adapterInfo . Adapter . SetData ( adapterInfo . SetData ) if err != nil { return err } getPathList := make ( [ ] string , 0 , len ( adapterInfo . SetData ) ) for path := range adapterInfo . SetData { getPathList = append ( getPathList , path ) } getData , err := adapterInfo . Adapter . GetData ( getPathList ) if err != nil { return err } for path , data := range getData { if ! reflect . DeepEqual ( adapterInfo . SetData [ path ] , data ) { return fmt . Errorf ( " " , path , data ) } } return nil }
GetSetData tests Get and Set adapter methods
GetSetData tests Get and Set adapter methods
// set data // get data // check data