/*
- * Copyright (c) 2014-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define TEST_COMMON_PROTOCOLS_TESTDATACOLLECTION_H_
#include <cstdint>
+#include <ctime>
+#include <limits>
+#include <vector>
+#include <types/Agent.h>
+#include <types/Policy.h>
#include <types/PolicyBucketId.h>
#include <types/PolicyKey.h>
#include <types/PolicyResult.h>
#include <types/ProtocolFields.h>
namespace {
+
namespace TestDataCollection {
+template <typename T,
+ T min_ = std::numeric_limits<T>::min(),
+ T max_ = std::numeric_limits<T>::max()
+ >
+struct NumericDataCollection {
+ static constexpr T min = min_;
+ static constexpr T max = max_;
+ static constexpr T min_1 = min_ + 1;
+ static constexpr T min_2 = min_ + 2;
+ static constexpr T max_1 = max_ - 1;
+ static constexpr T max_2 = max_ - 2;
+ static constexpr T mid = (min_ + max_) / 2;
+ static constexpr T all[] = {
+ min, max, min_1, min_2, max_1, max_2, mid
+ };
+};
+
+typedef NumericDataCollection<Cynara::ProtocolFrameSequenceNumber> SN;
+
typedef Cynara::PolicyKeyFeature PKF;
namespace Keys {
} /* namespace Keys */
-namespace SN {
-
-const Cynara::ProtocolFrameSequenceNumber min(0);
-const Cynara::ProtocolFrameSequenceNumber min_1(min + 1);
-const Cynara::ProtocolFrameSequenceNumber min_2(min + 2);
-const Cynara::ProtocolFrameSequenceNumber max(UINT16_MAX);
-const Cynara::ProtocolFrameSequenceNumber max_1(max - 1);
-const Cynara::ProtocolFrameSequenceNumber max_2(max - 2);
-const Cynara::ProtocolFrameSequenceNumber mid((min + max) / 2);
-const Cynara::ProtocolFrameSequenceNumber all[] = {
- min, min_1, min_2, max, max_1, max_2, mid
-};
-
-} /* namespace SN */
-
namespace Buckets {
const Cynara::PolicyBucketId empty("");
} /* namespace Buckets */
namespace Types {
- static const Cynara::PolicyType allow(Cynara::PredefinedPolicyType::ALLOW);
- static const Cynara::PolicyType deny(Cynara::PredefinedPolicyType::DENY);
- static const Cynara::PolicyType bucket(Cynara::PredefinedPolicyType::BUCKET);
- static const Cynara::PolicyType none(Cynara::PredefinedPolicyType::NONE);
- static const Cynara::PolicyType plugin_type(100);
+
+const Cynara::PolicyType allow(Cynara::PredefinedPolicyType::ALLOW);
+const Cynara::PolicyType deny(Cynara::PredefinedPolicyType::DENY);
+const Cynara::PolicyType bucket(Cynara::PredefinedPolicyType::BUCKET);
+const Cynara::PolicyType none(Cynara::PredefinedPolicyType::NONE);
+const Cynara::PolicyType plugin_type(100);
+const Cynara::PolicyType all[] = {
+ allow, deny, bucket, none, plugin_type
+};
+
} /* namespace Types */
namespace Results {
};
} /* namespace Results */
+
} /* namespace TestDataCollection */
} /* namespace anonymous */