mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-12 02:28:07 +02:00
29 lines
491 B
Go
29 lines
491 B
Go
|
package metric
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"testing"
|
||
|
"unsafe"
|
||
|
|
||
|
ottest "go.opentelemetry.io/otel/internal/testing"
|
||
|
)
|
||
|
|
||
|
// Ensure struct alignment prior to running tests.
|
||
|
func TestMain(m *testing.M) {
|
||
|
fields := []ottest.FieldOffset{
|
||
|
{
|
||
|
Name: "Batch.Measurments",
|
||
|
Offset: unsafe.Offsetof(Batch{}.Measurements),
|
||
|
},
|
||
|
{
|
||
|
Name: "Measurement.Number",
|
||
|
Offset: unsafe.Offsetof(Measurement{}.Number),
|
||
|
},
|
||
|
}
|
||
|
if !ottest.Aligned8Byte(fields, os.Stderr) {
|
||
|
os.Exit(1)
|
||
|
}
|
||
|
|
||
|
os.Exit(m.Run())
|
||
|
}
|