summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-04-06 17:08:15 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-04-10 17:57:10 -0400
commit5afa41551b3d8e0a84cf21cebfc89a194d326e76 (patch)
tree27018d5dc7aa801fee3e77af6be9c7693a178aa3 /src/usr/testcore
parentdee1ed49ad08fdb4b91775f50f65e69ad5bbfafa (diff)
downloadtalos-hostboot-5afa41551b3d8e0a84cf21cebfc89a194d326e76.tar.gz
talos-hostboot-5afa41551b3d8e0a84cf21cebfc89a194d326e76.zip
Add map list initialization and at() methods
Also add ErrnoToString() as a test which is a functionality ported from p8 Change-Id: Ia6dd9b37638af2634267e224d9b97133bf984fb4 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38956 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r--src/usr/testcore/lib/stltest.H20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/usr/testcore/lib/stltest.H b/src/usr/testcore/lib/stltest.H
index 227a3f5c7..c16354ff3 100644
--- a/src/usr/testcore/lib/stltest.H
+++ b/src/usr/testcore/lib/stltest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -95,6 +95,12 @@ class STLTest : public CxxTest::TestSuite
mymap[v5].value());
}
+ if (v5.value() != mymap.at(v5).value()) // map::at value
+ {
+ TS_FAIL("map::at() returned wrong value %d",
+ mymap.at(v5).value());
+ }
+
// test map::insert(v), map::insert(h,v), lower_bound()
mymap.insert(std::map<V,V>::value_type(v2,v2)); //map::insert(v);
@@ -483,6 +489,18 @@ class STLTest : public CxxTest::TestSuite
std::list< std::list<int> > l = { {},{1},{1,2,3} };
std::array<int, 5> a1 { {1,2,3,4,5} };
std::array<int, 5> a2 = {1,2,3,4,5};
+ std::map<int, int> m = {
+ {1, 100},
+ {2, 100},
+ {3, 100},
+ {4, 100},
+ };
+
+ if (m.size() != 4)
+ {
+ TS_FAIL("testInitListCompile(): std::map has an incorrect size after list initialization");
+ }
+
// Compiler warns that std::arrays are unused, so compare their
// sizes
if (a1.size() != a2.size())
OpenPOWER on IntegriCloud