summaryrefslogtreecommitdiffstats
path: root/mkspecs/wincewm50pocket-msvc2005/qplatformdefs.h
blob: ef9f2cb59eaa94a9c6ae651153a1d39313fe8cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include "../common/wince/qplatformdefs.h"

f5f16ec37370060222673085a5'>plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the files COPYING and Copyright.html.  COPYING can be found at the root   *
 * of the source code distribution tree; Copyright.html can be found at the  *
 * root level of an installed copy of the electronic HDF5 document set and   *
 * is linked from the top-level documents page.  It can also be found at     *
 * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html.  If you do not have     *
 * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/***********************************************************
*
* Test program:  tmeta
*
* Test the basic meta-data encode/decode macros calls.
*
*************************************************************/

#include "testhdf5.h"
#include "H5Fprivate.h"

#define TEST_INT16_VALUE    -7641
#define TEST_UINT16_VALUE   45002
#define TEST_INT32_VALUE    -981236
#define TEST_UINT32_VALUE   3476589

uint8_t                   compar_buffer[] =
{
    /* Little-endian encoded version of the 16-bit signed integer */
    (uint8_t) ((TEST_INT16_VALUE) & 0xff), (uint8_t) ((TEST_INT16_VALUE >> 8) & 0xff),
    /* Little-endian encoded version of the 16-bit unsigned integer */
    (uint8_t) ((TEST_UINT16_VALUE) & 0xff), (uint8_t) ((TEST_UINT16_VALUE >> 8) & 0xff),
    /* Little-endian encoded version of the 32-bit signed integer */
    (uint8_t) ((TEST_INT32_VALUE) & 0xff), (uint8_t) ((TEST_INT32_VALUE >> 8) & 0xff),
    (uint8_t) ((TEST_INT32_VALUE >> 16) & 0xff), (uint8_t) ((TEST_INT32_VALUE >> 24) & 0xff),
    /* Little-endian encoded version of the 32-bit unsigned integer */
    (uint8_t) ((TEST_UINT32_VALUE) & 0xff), (uint8_t) ((TEST_UINT32_VALUE >> 8) & 0xff),
    (uint8_t) ((TEST_UINT32_VALUE >> 16) & 0xff), (uint8_t) ((TEST_UINT32_VALUE >> 24) & 0xff),
};

uint8_t                   encode_buffer[sizeof(compar_buffer)];

/****************************************************************
**
**  test_metadata(): Main meta-data encode/decode testing routine.
**
****************************************************************/
void
test_metadata(void)
{
    int16_t     ei16 = TEST_INT16_VALUE;    /* variables to hold the values to encode */
    uint16_t    eu16 = TEST_UINT16_VALUE;
    int32_t     ei32 = TEST_INT32_VALUE;
    uint32_t    eu32 = TEST_UINT32_VALUE;
    int16_t     di16;       /* variables to hold the decoded values */
    uint16_t    du16;
    int32_t     di32;
    uint32_t    du32;
    uint8_t	*p;  /* pointer into the buffer being en/de-coded */

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Metadata Encoding/decoding\n"));

    /* Start by encoding the values above */
    p = encode_buffer;
    INT16ENCODE(p, ei16);       /* Encode the int16 value */
    UINT16ENCODE(p, eu16);      /* Encode the uint16 value */
    INT32ENCODE(p, ei32);       /* Encode the int32 value */
    UINT32ENCODE(p, eu32);      /* Encode the uint32 value */

    /* Check if we got what we asked for */
    if (HDmemcmp(encode_buffer, compar_buffer, sizeof(compar_buffer)) != 0) {
        unsigned                   u;      /* local counting variable */

        for (u = 0; u < sizeof(compar_buffer); u++) {
            if (compar_buffer[u] != encode_buffer[u])
                TestErrPrintf("Error encoding meta-data at offset %u, wanted: %u, got: %u\n", (unsigned) u, (unsigned) compar_buffer[u], (unsigned) encode_buffer[u]);
        }                       /* end for */
    }                           /* end if */
    /* Test decoding macros */
    p = encode_buffer;
    INT16DECODE(p, di16);       /* Decode the int16 value */
    UINT16DECODE(p, du16);      /* Decode the uint16 value */
    INT32DECODE(p, di32);       /* Decode the int32 value */
    UINT32DECODE(p, du32);      /* Decode the uint32 value */

    /* Check the values decoded */
    if (di16 != TEST_INT16_VALUE)
        TestErrPrintf("Error decoding int16 meta-data wanted: %d, got: %d "
                   "at %s:%d\n", (int) TEST_INT16_VALUE, (int) di16,
                   __FILE__, __LINE__);
    if (du16 != TEST_UINT16_VALUE)
        TestErrPrintf("Error decoding uint16 meta-data wanted: %u, got: %u "
                   "at %s:%d\n", (unsigned) TEST_UINT16_VALUE, (unsigned) du16,
                   __FILE__, __LINE__);
    if (di32 != TEST_INT32_VALUE)
        TestErrPrintf("Error decoding int32 meta-data wanted: %ld, got: %ld "
                   "at %s:%d\n", (long) TEST_INT32_VALUE, (long) di32,
                   __FILE__, __LINE__);
    if (du32 != TEST_UINT32_VALUE)
        TestErrPrintf("Error decoding uint32 meta-data wanted: %lu, got: %lu "
                   "at %s:%d\n", (unsigned long) TEST_UINT32_VALUE, (unsigned long) du32,
                   __FILE__, __LINE__);
}                               /* test_metadata() */


/*-------------------------------------------------------------------------
 * Function:	cleanup_metadata
 *
 * Purpose:	Cleanup temporary test files
 *
 * Return:	none
 *
 * Programmer:	Albert Cheng
 *              July 2, 1998
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
void
cleanup_metadata(void)
{
    /* no file to clean */
}