Skip to content

Commit a2efa20

Browse files
committed
Add test using dummy module for qt
1 parent 416bc9f commit a2efa20

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

tests/helpers/qt/core/metatype.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enum Q_DECLARE_METATYPE;

tests/single/test370.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
template <typename T>
3+
struct QMetaTypeId
4+
{
5+
};
6+
7+
#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
8+
#define Q_DECLARE_METATYPE_IMPL(TYPE) \
9+
template <> \
10+
struct QMetaTypeId< TYPE > \
11+
{ \
12+
enum { Defined = 1 }; \
13+
static int qt_metatype_id() \
14+
{ \
15+
return 1; \
16+
} \
17+
};
18+
19+
20+
struct S
21+
{
22+
};
23+
Q_DECLARE_METATYPE(S);

tests/single/test370.d

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
module test370;
3+
4+
import config;
5+
import cppconvhelpers;
6+
import qt.core.metatype;
7+
8+
struct QMetaTypeId(T)
9+
{
10+
}
11+
12+
/+ #define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
13+
#define Q_DECLARE_METATYPE_IMPL(TYPE) \
14+
template <> \
15+
struct QMetaTypeId< TYPE > \
16+
{ \
17+
enum { Defined = 1 }; \
18+
static int qt_metatype_id() \
19+
{ \
20+
return 1; \
21+
} \
22+
}; +/
23+
24+
25+
@Q_DECLARE_METATYPE struct S
26+
{
27+
}
28+
/+ Q_DECLARE_METATYPE(S); +/
29+

0 commit comments

Comments
 (0)