summaryrefslogtreecommitdiffstats
path: root/sample.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2016-09-09 12:15:46 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-09-28 13:34:35 +0000
commit00b1e5be1ce0d74541e371790e36a53146cb3b44 (patch)
treec07eb4866e773bc60952fabea72014ee2734bc89 /sample.cpp
parent41cae2b51107f06bfa50c6dd0fbc68a799a6c219 (diff)
downloadphosphor-host-ipmid-00b1e5be1ce0d74541e371790e36a53146cb3b44.tar.gz
phosphor-host-ipmid-00b1e5be1ce0d74541e371790e36a53146cb3b44.zip
Propose and implement unit test framework
Enable use of GoogleTest and created a sample unit test case. Change-Id: Ie370745a32777d4ed81ee24145364029c8e7bf02 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'sample.cpp')
-rw-r--r--sample.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/sample.cpp b/sample.cpp
new file mode 100644
index 0000000..451c6c4
--- /dev/null
+++ b/sample.cpp
@@ -0,0 +1,11 @@
+#include <sample.h>
+
+int Factorial(int n)
+{
+ int result = 1;
+ for (int i=1; i<=n; i++)
+ {
+ result *= i;
+ }
+ return result;
+}
OpenPOWER on IntegriCloud