Files
telemetry/pdata/pmetric/metric_data_point_flags_test.go
Alex BotenandGitHub 80d704deb4 [chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <[email protected]>

* make goporto

Signed-off-by: Alex Boten <[email protected]>

---------

Signed-off-by: Alex Boten <[email protected]>
2023-05-18 13:11:17 -07:00

31 lines
725 B
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package pmetric
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestLogRecordFlags(t *testing.T) {
flags := DataPointFlags(1)
assert.True(t, flags.NoRecordedValue())
assert.EqualValues(t, uint32(1), flags)
flags = flags.WithNoRecordedValue(false)
assert.False(t, flags.NoRecordedValue())
assert.EqualValues(t, uint32(0), flags)
flags = flags.WithNoRecordedValue(true)
assert.True(t, flags.NoRecordedValue())
assert.EqualValues(t, uint32(1), flags)
}
func TestDefaultLogRecordFlags(t *testing.T) {
flags := DefaultDataPointFlags
assert.False(t, flags.NoRecordedValue())
assert.EqualValues(t, uint32(0), flags)
}