diff options
author | Brad Bishop <bradleyb@us.ibm.com> | 2012-07-11 19:20:23 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-27 16:51:46 -0500 |
commit | f0474c846c82e55454b4d5809d67eaa6f0045265 (patch) | |
tree | 943eccf89188d9174ee72f3081d9741eea681bae /src/usr/diag/attn/test/attnfakeprd.H | |
parent | 6c92968b682e7437417520e51d82e7a93f1569f3 (diff) | |
download | talos-hostboot-f0474c846c82e55454b4d5809d67eaa6f0045265.tar.gz talos-hostboot-f0474c846c82e55454b4d5809d67eaa6f0045265.zip |
Attention handler fake PRD implementation.
Fake PRD implementation for unit testing.
Change-Id: I811c40451a56024f499957e650becb47ee62a66b
RTC: 41428
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1357
Tested-by: Jenkins Server
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-by: LARINA M. DSOUZA <larsouza@in.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/attn/test/attnfakeprd.H')
-rw-r--r-- | src/usr/diag/attn/test/attnfakeprd.H | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/usr/diag/attn/test/attnfakeprd.H b/src/usr/diag/attn/test/attnfakeprd.H new file mode 100644 index 000000000..0e35410ce --- /dev/null +++ b/src/usr/diag/attn/test/attnfakeprd.H @@ -0,0 +1,86 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/diag/attn/test/attnfakeprd.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_ATTNFAKEPRD_H +#define __TEST_ATTNFAKEPRD_H + +/** + * @file attnfakeprd.H + * + * @brief HBATTN fake PRD class definitions. + */ + +#include "attntest.H" +#include "../attnprd.H" + +namespace ATTN +{ + +/** + * @brief FakePrd + * + * Basic PRD implementation that eventually clears every attention it + * receives. + */ +class FakePrd : public PrdImpl +{ + public: + + /** + * @brief ctor + * + * @param[in] i_system The system where attentions + * should be cleared. + */ + explicit FakePrd(FakeSystem & i_system); + + /** + * @brief dtor + */ + ~FakePrd() {} + + /** + * @brief callPrd Simulate a call to PRD. + * + * Sleeps random intervals, to simulate PRD processing times. Periodically + * does not clear some attentions, to simulate real PRD behavior. + * + * @param[in] i_attentions List of attentions for PRD to analyze. + * + * @return errlHndl_t Error log. + * + * @retval[0] No error occurred. + * @retval[!0] Unexpected error occurred. + */ + errlHndl_t callPrd(const AttentionList & i_attentions); + + private: + + /** + * @brief iv_system The system where attentions should + * be cleared. + */ + FakeSystem * iv_system; +}; +} +#endif |