tstIprtList.cpp revision a462e9c5508784b4b91ff00f156011614ae806ba
fed88021ac57fb52130ac80953954919864d7e66vboxsync * IPRT Testcase - RTCList/RTCMTList.
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Copyright (C) 2011 Oracle Corporation
fed88021ac57fb52130ac80953954919864d7e66vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
fed88021ac57fb52130ac80953954919864d7e66vboxsync * available from http://www.virtualbox.org. This file is free software;
fed88021ac57fb52130ac80953954919864d7e66vboxsync * you can redistribute it and/or modify it under the terms of the GNU
fed88021ac57fb52130ac80953954919864d7e66vboxsync * General Public License (GPL) as published by the Free Software
fed88021ac57fb52130ac80953954919864d7e66vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
fed88021ac57fb52130ac80953954919864d7e66vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
fed88021ac57fb52130ac80953954919864d7e66vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
fed88021ac57fb52130ac80953954919864d7e66vboxsync * The contents of this file may alternatively be used under the terms
fed88021ac57fb52130ac80953954919864d7e66vboxsync * of the Common Development and Distribution License Version 1.0
fed88021ac57fb52130ac80953954919864d7e66vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
fed88021ac57fb52130ac80953954919864d7e66vboxsync * VirtualBox OSE distribution, in which case the provisions of the
fed88021ac57fb52130ac80953954919864d7e66vboxsync * CDDL are applicable instead of those of the GPL.
fed88021ac57fb52130ac80953954919864d7e66vboxsync * You may elect to license modified versions of this file under the
fed88021ac57fb52130ac80953954919864d7e66vboxsync * terms and conditions of either the GPL or the CDDL or both.
fed88021ac57fb52130ac80953954919864d7e66vboxsync/*******************************************************************************
fed88021ac57fb52130ac80953954919864d7e66vboxsync* Header Files *
fed88021ac57fb52130ac80953954919864d7e66vboxsync*******************************************************************************/
fed88021ac57fb52130ac80953954919864d7e66vboxsync/*******************************************************************************
fed88021ac57fb52130ac80953954919864d7e66vboxsync* Global Variables *
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync*******************************************************************************/
fed88021ac57fb52130ac80953954919864d7e66vboxsync/** Used for the string test. */
fed88021ac57fb52130ac80953954919864d7e66vboxsyncstatic const char *g_apszTestStrings[] =
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Vestibulum non turpis vel metus pellentesque tincidunt at id massa.",
0947602430c9ce096179270827ec44bf1cc532e6vboxsync "Cras quis erat sed nulla ullamcorper molestie.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Mauris ac elit turpis, id pulvinar diam.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Nulla quis dolor dolor, in ultrices diam.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Vivamus ac quam non ipsum vehicula tempor ac ac arcu.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Aenean posuere lacus blandit erat semper eu iaculis ante eleifend.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Donec quis quam a lacus interdum sollicitudin quis eu est.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Morbi sed nisi a arcu commodo convallis.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Aenean molestie condimentum velit, non mattis magna ultricies quis.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Nulla id velit at mauris gravida mattis.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Phasellus viverra velit eu urna semper in porta arcu sollicitudin.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Pellentesque consequat turpis et tortor hendrerit id tempor ipsum lacinia.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Cras iaculis nulla quis risus pulvinar eget tempor lectus placerat.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Nullam in nulla sed sapien euismod euismod.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Morbi in tortor at magna sagittis fermentum ut eu nunc.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Nulla vitae ante sit amet dui molestie sagittis lacinia quis tellus.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Proin iaculis lorem ultricies metus bibendum tincidunt.",
fed88021ac57fb52130ac80953954919864d7e66vboxsync "Sed gravida purus id risus sollicitudin ac porta orci vestibulum.",
RTAssertSetMayPanic(false);
RTAssertSetQuiet(true);
return VINF_SUCCESS;
return VINF_SUCCESS;
return VINF_SUCCESS;
MTTESTTYPE a;
return VINF_SUCCESS;
return VINF_SUCCESS;
return VINF_SUCCESS;
static void test2()
int rc;
MtTest1ThreadProc, MtTest2ThreadProc, MtTest3ThreadProc, MtTest4ThreadProc, MtTest5ThreadProc, MtTest6ThreadProc
int main()
if (rcExit)
return rcExit;
test1<RTCList, uint8_t, uint8_t, uint8_t>("ST: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
test1<RTCMTList, uint8_t, uint8_t, uint8_t>("MT: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
test1<RTCList, uint16_t, uint16_t, uint16_t>("ST: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
test1<RTCMTList, uint16_t, uint16_t, uint16_t>("MT: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
test1<RTCList, uint32_t, uint32_t, uint32_t>("ST: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
test1<RTCMTList, uint32_t, uint32_t, uint32_t>("MT: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
test1<RTCList, uint64_t, uint64_t, uint64_t>("ST: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
test1<RTCMTList, uint64_t, uint64_t, uint64_t>("MT: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
test1<RTCList, RTCString, RTCString *, const char *>("ST: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
test1<RTCMTList, RTCString, RTCString *, const char *>("MT: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
test2();