#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/segmentation_platform/internal/metadata/metadata_utils.h"
#include "base/metrics/metrics_hashes.h"
#include "components/segmentation_platform/internal/database/ukm_types.h"
#include "components/segmentation_platform/internal/execution/processing/query_processor.h"
#include "components/segmentation_platform/internal/post_processor/post_processing_test_utils.h"
#include "components/segmentation_platform/public/proto/aggregation.pb.h"
#include "components/segmentation_platform/public/proto/model_metadata.pb.h"
#include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace segmentation_platform {
namespace {
void AddDiscreteMapping(proto::SegmentationModelMetadata* metadata,
float mappings[][2],
int num_pairs,
const std::string& discrete_mapping_key) { … }
}
class MetadataUtilsTest : public testing::Test { … };
TEST_F(MetadataUtilsTest, SegmentInfoValidation) { … }
TEST_F(MetadataUtilsTest, ValidatingPredictionResultOptionalVsRepeated) { … }
TEST_F(MetadataUtilsTest, DefaultMetadataIsInvalid) { … }
TEST_F(MetadataUtilsTest, MetadataValidation) { … }
TEST_F(MetadataUtilsTest, MetadataUmaFeatureValidation) { … }
TEST_F(MetadataUtilsTest, MetadataSqlFeatureValidation) { … }
TEST_F(MetadataUtilsTest, MetadataSqlFeatureTensorLengthValidation) { … }
TEST_F(MetadataUtilsTest, MetadataCustomInputValidation) { … }
TEST_F(MetadataUtilsTest, ValidateMetadataAndFeatures) { … }
TEST_F(MetadataUtilsTest, ValidateMetadataAndInputFeatures) { … }
TEST_F(MetadataUtilsTest, MetadataIndexedTensorsValidation) { … }
TEST_F(MetadataUtilsTest, ValidateSegementInfoMetadataAndFeatures) { … }
TEST_F(MetadataUtilsTest, ValidateMultiClassClassifierWithNoClasses) { … }
TEST_F(MetadataUtilsTest, ValidateMultiClassClassifierWithBothThresholdTypes) { … }
TEST_F(MetadataUtilsTest,
ValidateMultiClassClassifierWithClassThresholdCountMismatch) { … }
TEST_F(MetadataUtilsTest, ValidateMultiClassClassifierSuccessfully) { … }
TEST_F(MetadataUtilsTest, SetFeatureNameHashesFromName) { … }
TEST_F(MetadataUtilsTest, HasFreshResults) { … }
TEST_F(MetadataUtilsTest, HasExpiredOrUnavailableResult) { … }
TEST_F(MetadataUtilsTest, GetTimeUnit) { … }
TEST_F(MetadataUtilsTest, SignalTypeToSignalKind) { … }
TEST_F(MetadataUtilsTest, SignalKindToSignalType) { … }
TEST_F(MetadataUtilsTest, CheckDiscreteMapping) { … }
TEST_F(MetadataUtilsTest, CheckDiscreteMappingInNonAscendingOrder) { … }
TEST_F(MetadataUtilsTest, CheckMissingDiscreteMapping) { … }
TEST_F(MetadataUtilsTest, CheckDefaultDiscreteMapping) { … }
TEST_F(MetadataUtilsTest, CheckMissingDefaultDiscreteMapping) { … }
TEST_F(MetadataUtilsTest, SegmetationModelMetadataToString) { … }
TEST_F(MetadataUtilsTest, GetAllUmaFeatures) { … }
TEST_F(MetadataUtilsTest, GetAllUmaFeaturesWithInputFeatures) { … }
TEST_F(MetadataUtilsTest, GetAllUmaFeaturesWithUMAOutput) { … }
TEST_F(MetadataUtilsTest, ConfigUsesLegacyOutput) { … }
}