MCPcopy Create free account
hub / github.com/apache/fory / CreateSample

Function CreateSample

benchmarks/go/models.go:222–247  ·  view source on GitHub ↗

CreateSample creates test data matching C++ benchmark

()

Source from the content-addressed store, hash-verified

220
221// CreateSample creates test data matching C++ benchmark
222func CreateSample() Sample {
223 return Sample{
224 IntValue: 123,
225 LongValue: 1230000,
226 FloatValue: 12.345,
227 DoubleValue: 1.234567,
228 ShortValue: 12345,
229 CharValue: '!', // 33
230 BooleanValue: true,
231 IntValueBoxed: 321,
232 LongValueBoxed: 3210000,
233 FloatValueBoxed: 54.321,
234 DoubleValueBoxed: 7.654321,
235 ShortValueBoxed: 32100,
236 CharValueBoxed: '$', // 36
237 BooleanValueBoxed: false,
238 IntArray: []int32{-1234, -123, -12, -1, 0, 1, 12, 123, 1234},
239 LongArray: []int64{-123400, -12300, -1200, -100, 0, 100, 1200, 12300, 123400},
240 FloatArray: []float32{-12.34, -12.3, -12.0, -1.0, 0.0, 1.0, 12.0, 12.3, 12.34},
241 DoubleArray: []float64{-1.234, -1.23, -12.0, -1.0, 0.0, 1.0, 12.0, 1.23, 1.234},
242 ShortArray: []int32{-1234, -123, -12, -1, 0, 1, 12, 123, 1234},
243 CharArray: []int32{'a', 's', 'd', 'f', 'A', 'S', 'D', 'F'},
244 BooleanArray: []bool{true, false, false, true},
245 String: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
246 }
247}
248
249// CreateMediaContent creates test data matching C++ benchmark
250func CreateMediaContent() MediaContent {

Calls

no outgoing calls