Skip to content

Commit

Permalink
Fix true_type and false_ type typdef with integral_constant
Browse files Browse the repository at this point in the history
Change-Id: Ie1a432be0d1b2a59a0e0521f251d6bdf8a11ac70
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/74942
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
aamarin authored and crgeddes committed Apr 2, 2019
1 parent ca03643 commit 8daf280
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/include/util/impl/integral.H
@@ -1,7 +1,7 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/include/util/traits/integral.H $ */
/* $Source: src/include/util/impl/integral.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
Expand Down Expand Up @@ -38,9 +38,8 @@ namespace std
constexpr value_type operator()() const { return value; }
};

struct true_type : integral_constant<bool, true> {};
struct false_type : integral_constant<bool, false> {};

typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
}
#endif
/* vim: set filetype=cpp : */
15 changes: 15 additions & 0 deletions src/usr/testcore/lib/integral.H
Expand Up @@ -82,6 +82,21 @@ class STLIntegralTest : public CxxTest::TestSuite
TS_FAIL("false_type is not false.");
}
}

void testTypes()
{
if (!std::is_same<std::true_type,
std::integral_constant<bool, true> >::value)
{
TS_FAIL("true_type and integral_constant<bool, true> are not the same type.");
}

if (!std::is_same<std::false_type,
std::integral_constant<bool, false> >::value)
{
TS_FAIL("true_type and integral_constant<bool, false> are not the same type.");
}
}
};

#endif
5 changes: 3 additions & 2 deletions src/usr/testcore/lib/makefile
Expand Up @@ -27,11 +27,12 @@ ROOTPATH = ../../../..
MODULE = testsyslib
#@TODO-RTC:151185-Turn enable all test cases
#TESTS = *.H
TESTS = stltest.H
#TODO RTC:204720
#TESTS += synctest.H
TESTS += tls.H

TESTS = stltest.H
TESTS += tls.H
TESTS += integral.H
SUBDIRS += runtime.d

include ${ROOTPATH}/config.mk

0 comments on commit 8daf280

Please sign in to comment.