testutil

package
v1.26.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callbacks

func Callbacks() *c.OpenVPNPluginCallbacks

func CreateCStringArray

func CreateCStringArray(strings []string) (**c.Char, []*c.Char)

CreateCStringArray creates a NULL-terminated C string array from a Go string slice. This is a helper function for testing CGO code.

The caller is responsible for freeing the memory by calling FreeCStringArray.

Parameters:

  • strings: A slice of Go strings to convert

Returns:

  • **c.Char: Pointer to a NULL-terminated array of C strings
  • []*c.Char: Slice of individual C string pointers (for cleanup)

func CreateEmptyCStringArray

func CreateEmptyCStringArray() **c.Char

CreateEmptyCStringArray creates a NULL-terminated empty C string array. This is useful for testing edge cases.

The caller is responsible for freeing the memory by calling c.Free on the returned pointer.

Returns:

  • **c.Char: Pointer to a NULL-terminated empty array

func FreeCStringArray

func FreeCStringArray(argv **c.Char, cStrings []*c.Char)

FreeCStringArray frees memory allocated by CreateCStringArray.

Parameters:

  • argv: The array pointer returned by CreateCStringArray
  • cStrings: The slice of C string pointers returned by CreateCStringArray

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL