| // Copyright 2020 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| //go:build !fuchsia |
| |
| package fidl_test |
| |
| import "syscall/zx" |
| |
| var handleCounter = 0 |
| |
| func handleClose(*zx.Handle) error { |
| return nil |
| } |
| |
| func handleReplace(handle zx.Handle, rights zx.Rights) (zx.Handle, error) { |
| return nextHandle(), nil |
| } |
| |
| func handleGetBasicInfo(handle *zx.Handle) (zx.InfoHandleBasic, error) { |
| panic("shouldn't be called on host") |
| } |
| |
| func channelClose(*zx.Channel) error { |
| return nil |
| } |
| |
| func newChannel(uint32) (zx.Channel, zx.Channel, error) { |
| return zx.Channel(nextHandle()), zx.Channel(nextHandle()), nil |
| } |
| |
| func newEvent(uint32) (zx.Event, error) { |
| return zx.Event(nextHandle()), nil |
| } |
| |
| func isHandleValid(handle *zx.Handle) bool { |
| return false |
| } |
| |
| func nextHandle() zx.Handle { |
| handleCounter++ |
| return zx.Handle(handleCounter) |
| } |