~ubuntu-branches/ubuntu/wily/qtbase-opensource-src/wily

« back to all changes in this revision

Viewing changes to tests/auto/corelib/global/qglobal/tst_qglobal.cpp

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 12:46:17 UTC
  • Revision ID: package-import@ubuntu.com-20130205124617-c8jouts182j002fx
Tags: upstream-5.0.1+dfsg
ImportĀ upstreamĀ versionĀ 5.0.1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
 
4
** Contact: http://www.qt-project.org/legal
 
5
**
 
6
** This file is part of the test suite of the Qt Toolkit.
 
7
**
 
8
** $QT_BEGIN_LICENSE:LGPL$
 
9
** Commercial License Usage
 
10
** Licensees holding valid commercial Qt licenses may use this file in
 
11
** accordance with the commercial license agreement provided with the
 
12
** Software or, alternatively, in accordance with the terms contained in
 
13
** a written agreement between you and Digia.  For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing.  For further information
 
15
** use the contact form at http://qt.digia.com/contact-us.
 
16
**
 
17
** GNU Lesser General Public License Usage
 
18
** Alternatively, this file may be used under the terms of the GNU Lesser
 
19
** General Public License version 2.1 as published by the Free Software
 
20
** Foundation and appearing in the file LICENSE.LGPL included in the
 
21
** packaging of this file.  Please review the following information to
 
22
** ensure the GNU Lesser General Public License version 2.1 requirements
 
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
24
**
 
25
** In addition, as a special exception, Digia gives you certain additional
 
26
** rights.  These rights are described in the Digia Qt LGPL Exception
 
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
28
**
 
29
** GNU General Public License Usage
 
30
** Alternatively, this file may be used under the terms of the GNU
 
31
** General Public License version 3.0 as published by the Free Software
 
32
** Foundation and appearing in the file LICENSE.GPL included in the
 
33
** packaging of this file.  Please review the following information to
 
34
** ensure the GNU General Public License version 3.0 requirements will be
 
35
** met: http://www.gnu.org/copyleft/gpl.html.
 
36
**
 
37
**
 
38
** $QT_END_LICENSE$
 
39
**
 
40
****************************************************************************/
 
41
 
 
42
 
 
43
#include <QtTest/QtTest>
 
44
#include <QtCore/qtypetraits.h>
 
45
 
 
46
class tst_QGlobal: public QObject
 
47
{
 
48
    Q_OBJECT
 
49
 
 
50
private slots:
 
51
    void qIsNull();
 
52
    void for_each();
 
53
    void qassert();
 
54
    void qtry();
 
55
    void checkptr();
 
56
    void qstaticassert();
 
57
    void qConstructorFunction();
 
58
    void isEnum();
 
59
    void qAlignOf();
 
60
};
 
61
 
 
62
void tst_QGlobal::qIsNull()
 
63
{
 
64
    double d = 0.0;
 
65
    float f = 0.0f;
 
66
 
 
67
    QVERIFY(::qIsNull(d));
 
68
    QVERIFY(::qIsNull(f));
 
69
 
 
70
    d += 0.000000001;
 
71
    f += 0.0000001f;
 
72
 
 
73
    QVERIFY(!::qIsNull(d));
 
74
    QVERIFY(!::qIsNull(f));
 
75
 
 
76
    d = -0.0;
 
77
    f = -0.0f;
 
78
 
 
79
    QVERIFY(::qIsNull(d));
 
80
    QVERIFY(::qIsNull(f));
 
81
}
 
82
 
 
83
void tst_QGlobal::for_each()
 
84
{
 
85
    QList<int> list;
 
86
    list << 0 << 1 << 2 << 3 << 4 << 5;
 
87
 
 
88
    int counter = 0;
 
89
    foreach(int i, list) {
 
90
        QCOMPARE(i, counter++);
 
91
    }
 
92
    QCOMPARE(counter, list.count());
 
93
 
 
94
    // do it again, to make sure we don't have any for-scoping
 
95
    // problems with older compilers
 
96
    counter = 0;
 
97
    foreach(int i, list) {
 
98
        QCOMPARE(i, counter++);
 
99
    }
 
100
    QCOMPARE(counter, list.count());
 
101
}
 
102
 
 
103
void tst_QGlobal::qassert()
 
104
{
 
105
    bool passed = false;
 
106
    if (false) {
 
107
        Q_ASSERT(false);
 
108
    } else {
 
109
        passed = true;
 
110
    }
 
111
    QVERIFY(passed);
 
112
 
 
113
    passed = false;
 
114
    if (false) {
 
115
        Q_ASSERT_X(false, "tst_QGlobal", "qassert");
 
116
    } else {
 
117
        passed = true;
 
118
    }
 
119
    QVERIFY(passed);
 
120
 
 
121
    passed = false;
 
122
    if (false)
 
123
        Q_ASSERT(false);
 
124
    else
 
125
        passed = true;
 
126
    QVERIFY(passed);
 
127
 
 
128
    passed = false;
 
129
    if (false)
 
130
        Q_ASSERT_X(false, "tst_QGlobal", "qassert");
 
131
    else
 
132
        passed = true;
 
133
    QVERIFY(passed);
 
134
}
 
135
 
 
136
void tst_QGlobal::qtry()
 
137
{
 
138
    int i = 0;
 
139
    QT_TRY {
 
140
        i = 1;
 
141
        QT_THROW(42);
 
142
        i = 2;
 
143
    } QT_CATCH(int) {
 
144
        QCOMPARE(i, 1);
 
145
        i = 7;
 
146
    }
 
147
#ifdef QT_NO_EXCEPTIONS
 
148
    QCOMPARE(i, 2);
 
149
#else
 
150
    QCOMPARE(i, 7);
 
151
#endif
 
152
 
 
153
    // check propper if/else scoping
 
154
    i = 0;
 
155
    if (true) {
 
156
        QT_TRY {
 
157
            i = 2;
 
158
            QT_THROW(42);
 
159
            i = 4;
 
160
        } QT_CATCH(int) {
 
161
            QCOMPARE(i, 2);
 
162
            i = 4;
 
163
        }
 
164
    } else {
 
165
        QCOMPARE(i, 0);
 
166
    }
 
167
    QCOMPARE(i, 4);
 
168
 
 
169
    i = 0;
 
170
    if (false) {
 
171
        QT_TRY {
 
172
            i = 2;
 
173
            QT_THROW(42);
 
174
            i = 4;
 
175
        } QT_CATCH(int) {
 
176
            QCOMPARE(i, 2);
 
177
            i = 2;
 
178
        }
 
179
    } else {
 
180
        i = 8;
 
181
    }
 
182
    QCOMPARE(i, 8);
 
183
 
 
184
    i = 0;
 
185
    if (false) {
 
186
        i = 42;
 
187
    } else {
 
188
        QT_TRY {
 
189
            i = 2;
 
190
            QT_THROW(42);
 
191
            i = 4;
 
192
        } QT_CATCH(int) {
 
193
            QCOMPARE(i, 2);
 
194
            i = 4;
 
195
        }
 
196
    }
 
197
    QCOMPARE(i, 4);
 
198
}
 
199
 
 
200
void tst_QGlobal::checkptr()
 
201
{
 
202
    int i;
 
203
    QCOMPARE(q_check_ptr(&i), &i);
 
204
 
 
205
    const char *c = "hello";
 
206
    QCOMPARE(q_check_ptr(c), c);
 
207
}
 
208
 
 
209
// Check Q_STATIC_ASSERT, It should compile
 
210
// note that, we are not able to test Q_STATIC_ASSERT(false), to do it manually someone has
 
211
// to replace expressions (in the asserts) one by one to false, and check if it breaks build.
 
212
class MyTrue
 
213
{
 
214
public:
 
215
    MyTrue()
 
216
    {
 
217
        Q_STATIC_ASSERT(true);
 
218
        Q_STATIC_ASSERT(!false);
 
219
        Q_STATIC_ASSERT_X(true,"");
 
220
        Q_STATIC_ASSERT_X(!false,"");
 
221
    }
 
222
    ~MyTrue()
 
223
    {
 
224
        Q_STATIC_ASSERT(true);
 
225
        Q_STATIC_ASSERT(!false);
 
226
        Q_STATIC_ASSERT_X(true,"");
 
227
        Q_STATIC_ASSERT_X(!false,"");
 
228
    }
 
229
    Q_STATIC_ASSERT(true);
 
230
    Q_STATIC_ASSERT(!false);
 
231
    Q_STATIC_ASSERT_X(true,"");
 
232
    Q_STATIC_ASSERT_X(!false,"");
 
233
};
 
234
 
 
235
struct MyExpresion
 
236
{
 
237
    void foo()
 
238
    {
 
239
        Q_STATIC_ASSERT(sizeof(MyTrue) > 0);
 
240
        Q_STATIC_ASSERT(sizeof(MyTrue) > 0);
 
241
        Q_STATIC_ASSERT_X(sizeof(MyTrue) > 0,"");
 
242
        Q_STATIC_ASSERT_X(sizeof(MyTrue) > 0,"");
 
243
    }
 
244
private:
 
245
    Q_STATIC_ASSERT(sizeof(MyTrue) > 0);
 
246
    Q_STATIC_ASSERT(sizeof(MyTrue) > 0);
 
247
    Q_STATIC_ASSERT_X(sizeof(MyTrue) > 0, "");
 
248
    Q_STATIC_ASSERT_X(sizeof(MyTrue) > 0, "");
 
249
};
 
250
 
 
251
struct TypeDef
 
252
{
 
253
    typedef int T;
 
254
    Q_STATIC_ASSERT(sizeof(T));
 
255
    Q_STATIC_ASSERT_X(sizeof(T), "");
 
256
};
 
257
 
 
258
template<typename T1, typename T2>
 
259
struct Template
 
260
{
 
261
    static const bool True = true;
 
262
    typedef typename T1::T DependentType;
 
263
    Q_STATIC_ASSERT(True);
 
264
    Q_STATIC_ASSERT(!!True);
 
265
    Q_STATIC_ASSERT(sizeof(DependentType));
 
266
    Q_STATIC_ASSERT(!!sizeof(DependentType));
 
267
    Q_STATIC_ASSERT_X(True, "");
 
268
    Q_STATIC_ASSERT_X(!!True, "");
 
269
    Q_STATIC_ASSERT_X(sizeof(DependentType), "");
 
270
    Q_STATIC_ASSERT_X(!!sizeof(DependentType), "");
 
271
};
 
272
 
 
273
struct MyTemplate
 
274
{
 
275
    static const bool Value = Template<TypeDef, int>::True;
 
276
    Q_STATIC_ASSERT(Value);
 
277
    Q_STATIC_ASSERT(!!Value);
 
278
    Q_STATIC_ASSERT_X(Value, "");
 
279
    Q_STATIC_ASSERT_X(!!Value, "");
 
280
};
 
281
 
 
282
void tst_QGlobal::qstaticassert()
 
283
{
 
284
    // Force compilation of these classes
 
285
    MyTrue tmp1;
 
286
    MyExpresion tmp2;
 
287
    MyTemplate tmp3;
 
288
    Q_UNUSED(tmp1);
 
289
    Q_UNUSED(tmp2);
 
290
    Q_UNUSED(tmp3);
 
291
    QVERIFY(true); // if the test compiles it has passed.
 
292
}
 
293
 
 
294
static int qConstructorFunctionValue;
 
295
static void qConstructorFunctionCtor()
 
296
{
 
297
    qConstructorFunctionValue = 123;
 
298
}
 
299
Q_CONSTRUCTOR_FUNCTION(qConstructorFunctionCtor);
 
300
 
 
301
void tst_QGlobal::qConstructorFunction()
 
302
{
 
303
    QCOMPARE(qConstructorFunctionValue, 123);
 
304
}
 
305
 
 
306
struct isEnum_A {
 
307
    int n_;
 
308
};
 
309
 
 
310
enum isEnum_B_Byte { isEnum_B_Byte_x = 63 };
 
311
enum isEnum_B_Short { isEnum_B_Short_x = 1024 };
 
312
enum isEnum_B_Int { isEnum_B_Int_x = 1 << 20 };
 
313
 
 
314
union isEnum_C {};
 
315
 
 
316
class isEnum_D {
 
317
public:
 
318
    operator int() const;
 
319
};
 
320
 
 
321
class isEnum_E {
 
322
private:
 
323
    operator int() const;
 
324
};
 
325
 
 
326
class isEnum_F {
 
327
public:
 
328
    enum AnEnum {};
 
329
};
 
330
 
 
331
#if defined (Q_COMPILER_CLASS_ENUM)
 
332
enum class isEnum_G : qint64 {};
 
333
#endif
 
334
 
 
335
void tst_QGlobal::isEnum()
 
336
{
 
337
#if defined (Q_CC_MSVC)
 
338
#define IS_ENUM_TRUE(x)     (Q_IS_ENUM(x) == true)
 
339
#define IS_ENUM_FALSE(x)    (Q_IS_ENUM(x) == false)
 
340
#else
 
341
#define IS_ENUM_TRUE(x)     (Q_IS_ENUM(x) == true && QtPrivate::is_enum<x>::value == true)
 
342
#define IS_ENUM_FALSE(x)    (Q_IS_ENUM(x) == false && QtPrivate::is_enum<x>::value == false)
 
343
#endif
 
344
 
 
345
    QVERIFY(IS_ENUM_TRUE(isEnum_B_Byte));
 
346
    QVERIFY(IS_ENUM_TRUE(const isEnum_B_Byte));
 
347
    QVERIFY(IS_ENUM_TRUE(volatile isEnum_B_Byte));
 
348
    QVERIFY(IS_ENUM_TRUE(const volatile isEnum_B_Byte));
 
349
 
 
350
    QVERIFY(IS_ENUM_TRUE(isEnum_B_Short));
 
351
    QVERIFY(IS_ENUM_TRUE(const isEnum_B_Short));
 
352
    QVERIFY(IS_ENUM_TRUE(volatile isEnum_B_Short));
 
353
    QVERIFY(IS_ENUM_TRUE(const volatile isEnum_B_Short));
 
354
 
 
355
    QVERIFY(IS_ENUM_TRUE(isEnum_B_Int));
 
356
    QVERIFY(IS_ENUM_TRUE(const isEnum_B_Int));
 
357
    QVERIFY(IS_ENUM_TRUE(volatile isEnum_B_Int));
 
358
    QVERIFY(IS_ENUM_TRUE(const volatile isEnum_B_Int));
 
359
 
 
360
    QVERIFY(IS_ENUM_TRUE(isEnum_F::AnEnum));
 
361
    QVERIFY(IS_ENUM_TRUE(const isEnum_F::AnEnum));
 
362
    QVERIFY(IS_ENUM_TRUE(volatile isEnum_F::AnEnum));
 
363
    QVERIFY(IS_ENUM_TRUE(const volatile isEnum_F::AnEnum));
 
364
 
 
365
    QVERIFY(IS_ENUM_FALSE(void));
 
366
    QVERIFY(IS_ENUM_FALSE(isEnum_B_Byte &));
 
367
    QVERIFY(IS_ENUM_FALSE(isEnum_B_Byte[1]));
 
368
    QVERIFY(IS_ENUM_FALSE(const isEnum_B_Byte[1]));
 
369
    QVERIFY(IS_ENUM_FALSE(isEnum_B_Byte[]));
 
370
    QVERIFY(IS_ENUM_FALSE(int));
 
371
    QVERIFY(IS_ENUM_FALSE(float));
 
372
    QVERIFY(IS_ENUM_FALSE(isEnum_A));
 
373
    QVERIFY(IS_ENUM_FALSE(isEnum_A *));
 
374
    QVERIFY(IS_ENUM_FALSE(const isEnum_A));
 
375
    QVERIFY(IS_ENUM_FALSE(isEnum_C));
 
376
    QVERIFY(IS_ENUM_FALSE(isEnum_D));
 
377
    QVERIFY(IS_ENUM_FALSE(isEnum_E));
 
378
    QVERIFY(IS_ENUM_FALSE(void()));
 
379
    QVERIFY(IS_ENUM_FALSE(void(*)()));
 
380
    QVERIFY(IS_ENUM_FALSE(int isEnum_A::*));
 
381
    QVERIFY(IS_ENUM_FALSE(void (isEnum_A::*)()));
 
382
 
 
383
    QVERIFY(IS_ENUM_FALSE(size_t));
 
384
    QVERIFY(IS_ENUM_FALSE(bool));
 
385
    QVERIFY(IS_ENUM_FALSE(wchar_t));
 
386
 
 
387
    QVERIFY(IS_ENUM_FALSE(char));
 
388
    QVERIFY(IS_ENUM_FALSE(unsigned char));
 
389
    QVERIFY(IS_ENUM_FALSE(short));
 
390
    QVERIFY(IS_ENUM_FALSE(unsigned short));
 
391
    QVERIFY(IS_ENUM_FALSE(int));
 
392
    QVERIFY(IS_ENUM_FALSE(unsigned int));
 
393
    QVERIFY(IS_ENUM_FALSE(long));
 
394
    QVERIFY(IS_ENUM_FALSE(unsigned long));
 
395
 
 
396
    QVERIFY(IS_ENUM_FALSE(qint8));
 
397
    QVERIFY(IS_ENUM_FALSE(quint8));
 
398
    QVERIFY(IS_ENUM_FALSE(qint16));
 
399
    QVERIFY(IS_ENUM_FALSE(quint16));
 
400
    QVERIFY(IS_ENUM_FALSE(qint32));
 
401
    QVERIFY(IS_ENUM_FALSE(quint32));
 
402
    QVERIFY(IS_ENUM_FALSE(qint64));
 
403
    QVERIFY(IS_ENUM_FALSE(quint64));
 
404
 
 
405
    QVERIFY(IS_ENUM_FALSE(void *));
 
406
    QVERIFY(IS_ENUM_FALSE(int *));
 
407
 
 
408
#if defined (Q_COMPILER_UNICODE_STRINGS)
 
409
    QVERIFY(IS_ENUM_FALSE(char16_t));
 
410
    QVERIFY(IS_ENUM_FALSE(char32_t));
 
411
#endif
 
412
 
 
413
#if defined (Q_COMPILER_CLASS_ENUM)
 
414
    // Strongly type class enums are not handled by the
 
415
    // fallback type traits implementation. Any compiler
 
416
    // supported by Qt that supports C++0x class enums
 
417
    // should also support the __is_enum intrinsic.
 
418
    QVERIFY(Q_IS_ENUM(isEnum_G) == true);
 
419
#endif
 
420
 
 
421
#undef IS_ENUM_TRUE
 
422
#undef IS_ENUM_FALSE
 
423
}
 
424
 
 
425
struct Empty {};
 
426
template <class T> struct AlignmentInStruct { T dummy; };
 
427
 
 
428
typedef int (*fun) ();
 
429
typedef int (Empty::*memFun) ();
 
430
 
 
431
#define TEST_AlignOf(type, alignment)                                       \
 
432
    do {                                                                    \
 
433
        TEST_AlignOf_impl(type, alignment);                                 \
 
434
                                                                            \
 
435
        TEST_AlignOf_impl(type &, alignment);                               \
 
436
        TEST_AlignOf_RValueRef(type &&, alignment);                         \
 
437
                                                                            \
 
438
        TEST_AlignOf_impl(type [5], alignment);                             \
 
439
        TEST_AlignOf_impl(type (&) [5], alignment);                         \
 
440
                                                                            \
 
441
        TEST_AlignOf_impl(AlignmentInStruct<type>, alignment);              \
 
442
                                                                            \
 
443
        /* Some internal sanity validation, just for fun */                 \
 
444
        TEST_AlignOf_impl(AlignmentInStruct<type [5]>, alignment);          \
 
445
        TEST_AlignOf_impl(AlignmentInStruct<type &>, Q_ALIGNOF(void *));    \
 
446
        TEST_AlignOf_impl(AlignmentInStruct<type (&) [5]>,                  \
 
447
                Q_ALIGNOF(void *));                                         \
 
448
        TEST_AlignOf_RValueRef(AlignmentInStruct<type &&>,                  \
 
449
                Q_ALIGNOF(void *));                                         \
 
450
    } while (false)                                                         \
 
451
    /**/
 
452
 
 
453
#ifdef Q_COMPILER_RVALUE_REFS
 
454
#define TEST_AlignOf_RValueRef(type, alignment) \
 
455
        TEST_AlignOf_impl(type, alignment)
 
456
#else
 
457
#define TEST_AlignOf_RValueRef(type, alignment) do {} while (false)
 
458
#endif
 
459
 
 
460
#define TEST_AlignOf_impl(type, alignment) \
 
461
    do { \
 
462
        QCOMPARE(Q_ALIGNOF(type), size_t(alignment)); \
 
463
        /* Compare to native operator for compilers that support it,
 
464
           otherwise...  erm... check consistency! :-) */ \
 
465
        QCOMPARE(QT_EMULATED_ALIGNOF(type), Q_ALIGNOF(type)); \
 
466
    } while (false)
 
467
    /**/
 
468
 
 
469
void tst_QGlobal::qAlignOf()
 
470
{
 
471
    // Built-in types, except 64-bit integers and double
 
472
    TEST_AlignOf(char, 1);
 
473
    TEST_AlignOf(signed char, 1);
 
474
    TEST_AlignOf(unsigned char, 1);
 
475
    TEST_AlignOf(qint8, 1);
 
476
    TEST_AlignOf(quint8, 1);
 
477
    TEST_AlignOf(qint16, 2);
 
478
    TEST_AlignOf(quint16, 2);
 
479
    TEST_AlignOf(qint32, 4);
 
480
    TEST_AlignOf(quint32, 4);
 
481
    TEST_AlignOf(void *, sizeof(void *));
 
482
 
 
483
    // Depends on platform and compiler, disabling test for now
 
484
    // TEST_AlignOf(long double, 16);
 
485
 
 
486
    // Empty struct
 
487
    TEST_AlignOf(Empty, 1);
 
488
 
 
489
    // Function pointers
 
490
    TEST_AlignOf(fun, Q_ALIGNOF(void *));
 
491
    TEST_AlignOf(memFun, Q_ALIGNOF(void *));
 
492
 
 
493
 
 
494
    // 64-bit integers and double
 
495
    TEST_AlignOf_impl(qint64, 8);
 
496
    TEST_AlignOf_impl(quint64, 8);
 
497
    TEST_AlignOf_impl(double, 8);
 
498
 
 
499
    TEST_AlignOf_impl(qint64 &, 8);
 
500
    TEST_AlignOf_impl(quint64 &, 8);
 
501
    TEST_AlignOf_impl(double &, 8);
 
502
 
 
503
    TEST_AlignOf_RValueRef(qint64 &&, 8);
 
504
    TEST_AlignOf_RValueRef(quint64 &&, 8);
 
505
    TEST_AlignOf_RValueRef(double &&, 8);
 
506
 
 
507
    // 32-bit x86 ABI idiosyncrasies
 
508
#if defined(Q_PROCESSOR_X86_32) && !defined(Q_OS_WIN)
 
509
    TEST_AlignOf_impl(AlignmentInStruct<qint64>, 4);
 
510
#else
 
511
    TEST_AlignOf_impl(AlignmentInStruct<qint64>, 8);
 
512
#endif
 
513
 
 
514
    TEST_AlignOf_impl(AlignmentInStruct<quint64>, Q_ALIGNOF(AlignmentInStruct<qint64>));
 
515
    TEST_AlignOf_impl(AlignmentInStruct<double>, Q_ALIGNOF(AlignmentInStruct<qint64>));
 
516
 
 
517
    // 32-bit x86 ABI, Clang disagrees with gcc
 
518
#if !defined(Q_PROCESSOR_X86_32) || !defined(Q_CC_CLANG)
 
519
    TEST_AlignOf_impl(qint64 [5],       Q_ALIGNOF(qint64));
 
520
#else
 
521
    TEST_AlignOf_impl(qint64 [5],       Q_ALIGNOF(AlignmentInStruct<qint64>));
 
522
#endif
 
523
 
 
524
    TEST_AlignOf_impl(qint64 (&) [5],   Q_ALIGNOF(qint64 [5]));
 
525
    TEST_AlignOf_impl(quint64 [5],      Q_ALIGNOF(quint64 [5]));
 
526
    TEST_AlignOf_impl(quint64 (&) [5],  Q_ALIGNOF(quint64 [5]));
 
527
    TEST_AlignOf_impl(double [5],       Q_ALIGNOF(double [5]));
 
528
    TEST_AlignOf_impl(double (&) [5],   Q_ALIGNOF(double [5]));
 
529
}
 
530
 
 
531
#undef TEST_AlignOf
 
532
#undef TEST_AlignOf_RValueRef
 
533
#undef TEST_AlignOf_impl
 
534
 
 
535
QTEST_MAIN(tst_QGlobal)
 
536
#include "tst_qglobal.moc"