summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/attn/test/attncomp.H
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@us.ibm.com>2012-07-12 15:35:56 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-08-15 12:48:21 -0500
commitd268066a67809fa018b840f53163805f583aadcd (patch)
treed30c1fb836ae07b8f5770ff9ec13f3a80c6d543f /src/usr/diag/attn/test/attncomp.H
parent122f4ba48151f29cfb8be1d411509a219bd1df12 (diff)
downloadtalos-hostboot-d268066a67809fa018b840f53163805f583aadcd.tar.gz
talos-hostboot-d268066a67809fa018b840f53163805f583aadcd.zip
Attention handler fake system.
A fake hardware implementation framework for unit testing. Change-Id: I596c26d4c10a0f707c9eab29419b36e8ed11ac6b RTC: 41428 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1356 Tested-by: Jenkins Server Reviewed-by: LARINA M. DSOUZA <larsouza@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/attn/test/attncomp.H')
-rw-r--r--src/usr/diag/attn/test/attncomp.H105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/usr/diag/attn/test/attncomp.H b/src/usr/diag/attn/test/attncomp.H
new file mode 100644
index 000000000..5d0538905
--- /dev/null
+++ b/src/usr/diag/attn/test/attncomp.H
@@ -0,0 +1,105 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/diag/attn/test/attncomp.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
+#ifndef __TEST_ATTNCOMP_H
+#define __TEST_ATTNCOMP_H
+
+/**
+ * @file attncomp.H
+ *
+ * @brief HBATTN test lib comparison functors.
+ */
+
+#include "attntest.H"
+
+namespace ATTN
+{
+
+/**
+ * @brief AttnDataSwo Less than comparison functor for PRDF::AttnData structs.
+ */
+class AttnDataSwo
+{
+ public:
+
+ /**
+ * @brief operator() Less than comparison for PRDF::AttnData structs.
+ *
+ * @param[in] i_l One of two PRDF::AttnData structs to be compared.
+ * @param[in] i_r One of two PRDF::AttnData structs to be compared.
+ *
+ * @return bool Comparison result.
+ *
+ * @retval[true] i_l < i_r;
+ * @retval[false] i_r < i_l;
+ */
+ bool operator()(
+ const PRDF::AttnData & i_l,
+ const PRDF::AttnData & i_r) const
+ {
+ return compare(i_l, i_r) < 0;
+ }
+};
+
+/**
+ * @brief AttnDataEq Equality comparison predicate for PRDF::AttnData structs.
+ */
+class AttnDataEq
+{
+ public:
+
+ /**
+ * @brief operator() Equality comparison for PRDF::AttnData structs.
+ *
+ * @param[in] i_r One of two PRDF::AttnData structs to be compared.
+ *
+ * @return bool Comparison result.
+ *
+ * @retval[true] i_l == i_r;
+ * @retval[false] i_l != i_r;
+ */
+ bool operator()(
+ const PRDF::AttnData & i_r) const
+ {
+ return compare(iv_d, i_r) == 0;
+ }
+
+ /**
+ * @brief ctor
+ *
+ * @param[in] i_l One of two PRDF::AttnData structs to be compared.
+ */
+ explicit AttnDataEq(const PRDF::AttnData & i_l) :
+ iv_d(i_l) {}
+
+ private:
+
+ /**
+ * @brief iv_d
+ *
+ * One of two PRDF::AttnData structs to be compared.
+ */
+ const PRDF::AttnData & iv_d;
+};
+}
+#endif
OpenPOWER on IntegriCloud