From 5afa41551b3d8e0a84cf21cebfc89a194d326e76 Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Thu, 6 Apr 2017 17:08:15 -0500 Subject: 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 Reviewed-by: Nicholas E. Bofferding Reviewed-by: Martin Gloff Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/usr/testcore/lib/stltest.H | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/usr/testcore/lib') 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::value_type(v2,v2)); //map::insert(v); @@ -483,6 +489,18 @@ class STLTest : public CxxTest::TestSuite std::list< std::list > l = { {},{1},{1,2,3} }; std::array a1 { {1,2,3,4,5} }; std::array a2 = {1,2,3,4,5}; + std::map 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()) -- cgit v1.2.3