cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# $Id$
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Value Unit Definititions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis must correspond 1:1 with include/iprt/test.h and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncinclude/VBox/VMMDevTesting.h.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync__copyright__ = \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncavailable from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncyou can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGeneral Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThe contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncof the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncYou may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncterms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync__version__ = "$Revision$"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## @name Unit constants.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## Used everywhere.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## @note Using upper case here so we can copy, past and chop from the other
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# headers.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## @{
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPCT = 0x01;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncBYTES = 0x02;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncBYTES_PER_SEC = 0x03;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncKILOBYTES = 0x04;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncKILOBYTES_PER_SEC = 0x05;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncMEGABYTES = 0x06;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncMEGABYTES_PER_SEC = 0x07;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPACKETS = 0x08;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPACKETS_PER_SEC = 0x09;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFRAMES = 0x0a;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFRAMES_PER_SEC = 0x0b;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncOCCURRENCES = 0x0c;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncOCCURRENCES_PER_SEC = 0x0d;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCALLS = 0x0e;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCALLS_PER_SEC = 0x0f;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncROUND_TRIP = 0x10;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncSECS = 0x11;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncMS = 0x12;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS = 0x13;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS_PER_CALL = 0x14;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS_PER_FRAME = 0x15;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS_PER_OCCURRENCE = 0x16;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS_PER_PACKET = 0x17;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNS_PER_ROUND_TRIP = 0x18;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncINSTRS = 0x19;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncINSTRS_PER_SEC = 0x1a;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncNONE = 0x1b;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPP1K = 0x1c;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPP10K = 0x1d;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPPM = 0x1e;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPPB = 0x1f;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncEND = 0x20;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## @}
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## Translate constant to string.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_asNames = \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync[
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'invalid', # 0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '%',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'bytes',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'bytes/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'KiB',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'KiB/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'MiB',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'MiB/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'packets',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'packets/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'frames',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'frames/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'occurrences',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'occurrences/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'calls',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'calls/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'roundtrips',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 's',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ms',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns/call',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns/frame',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns/occurrences',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns/packet',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ns/roundtrips',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ins',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ins/s',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '', # none
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'pp1k',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'pp10k',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ppm',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ppb',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncassert g_asNames[PP1K] == 'pp1k';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## Translation table for XML -> number.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncg_kdNameToConst = \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync{
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'KB': KILOBYTES,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'KB/s': KILOBYTES_PER_SEC,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'MB': MEGABYTES,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'MB/s': MEGABYTES_PER_SEC,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'occurrences': OCCURRENCES,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'occurrences/s': OCCURRENCES_PER_SEC,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync};
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfor i in range(1, len(g_asNames)):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync g_kdNameToConst[g_asNames[i]] = i;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync