fuzzer

package
v0.0.0-...-d662972 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
	return []interface{}{
		func(s *restaurant.PizzaSpec, c fuzz.Continue) {
			c.FuzzNoCustom(s)

			if len(s.Toppings) == 0 {
				s.Toppings = []restaurant.PizzaTopping{
					{"salami", 1},
					{"mozzarella", 1},
					{"tomato", 1},
				}
			}

			seen := map[string]bool{}
			for i := range s.Toppings {

				s.Toppings[i].Quantity = 1 + c.Intn(10)

				for {
					if !seen[s.Toppings[i].Name] {
						break
					}
					s.Toppings[i].Name = c.RandString()
				}
				seen[s.Toppings[i].Name] = true
			}
		},
	}
}

Funcs returns the fuzzer functions for the restaurant api group.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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