Skip to content

Commit 5926beb

Browse files
committed
Add test case for typedef doc association
This test case shows that the documentation entry for a typedef is added to the first typedef found with the same name even if they do not belong to the same group. This test case produces the following warnings: 100_a.c:72: warning: Member documentation for T found several times in @InGroup groups!
1 parent a32006b commit 5926beb

File tree

7 files changed

+129
-4
lines changed

7 files changed

+129
-4
lines changed

testing/100/group___a.xml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<compoundname>A</compoundname>
55
<title>A</title>
66
<innerfile refid="100__a_8c">100_a.c</innerfile>
7+
<innerclass refid="structs" prot="public">s</innerclass>
78
<sectiondef kind="enum">
89
<memberdef kind="enum" id="group___a_1gaa57b8491d1d8fc1014dd54bcf83b130a" prot="public" static="no" strong="no">
910
<type/>
@@ -36,7 +37,25 @@
3637
</detaileddescription>
3738
<inbodydescription>
3839
</inbodydescription>
39-
<location file="100_a.c" line="21" column="1" bodyfile="100_a.c" bodystart="21" bodyend="31"/>
40+
<location file="100_a.c" line="22" column="1" bodyfile="100_a.c" bodystart="22" bodyend="32"/>
41+
</memberdef>
42+
</sectiondef>
43+
<sectiondef kind="typedef">
44+
<memberdef kind="typedef" id="group___a_1ga4ed70e44cd9d80a2082e1ae033eb7fc3" prot="public" static="no">
45+
<type>struct <ref refid="structs" kindref="compound">s</ref></type>
46+
<definition>struct s T</definition>
47+
<argsstring/>
48+
<name>T</name>
49+
<briefdescription>
50+
<para>T in <ref refid="100__a_8c" kindref="compound">100_a.c</ref>. </para>
51+
</briefdescription>
52+
<detaileddescription>
53+
<para>More for T in <ref refid="100__a_8c" kindref="compound">100_a.c</ref> from <ref refid="more__100__c_8c" kindref="compound">more_100_c.c</ref>.</para>
54+
<para>More for T in <ref refid="more__100__b_8c" kindref="compound">more_100_b.c</ref> from <ref refid="more__100__c_8c" kindref="compound">more_100_c.c</ref>. </para>
55+
</detaileddescription>
56+
<inbodydescription>
57+
</inbodydescription>
58+
<location file="100_a.c" line="72" column="16" bodyfile="100_a.c" bodystart="72" bodyend="-1"/>
4059
</memberdef>
4160
</sectiondef>
4261
<sectiondef kind="func">
@@ -56,7 +75,7 @@
5675
</detaileddescription>
5776
<inbodydescription>
5877
</inbodydescription>
59-
<location file="100_a.c" line="45" column="13" bodyfile="100_a.c" bodystart="45" bodyend="45"/>
78+
<location file="100_a.c" line="46" column="13" bodyfile="100_a.c" bodystart="46" bodyend="46"/>
6079
</memberdef>
6180
<memberdef kind="function" id="group___a_1ga5806fbe7d2114068e8085236b6f8098d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
6281
<type>void</type>
@@ -74,7 +93,7 @@
7493
</detaileddescription>
7594
<inbodydescription>
7695
</inbodydescription>
77-
<location file="100_a.c" line="52" column="6" bodyfile="100_a.c" bodystart="52" bodyend="52"/>
96+
<location file="100_a.c" line="53" column="6" bodyfile="100_a.c" bodystart="53" bodyend="53"/>
7897
</memberdef>
7998
</sectiondef>
8099
<sectiondef kind="define">
@@ -89,7 +108,7 @@
89108
</detaileddescription>
90109
<inbodydescription>
91110
</inbodydescription>
92-
<location file="100_a.c" line="38" column="9"/>
111+
<location file="100_a.c" line="39" column="9"/>
93112
</memberdef>
94113
</sectiondef>
95114
<briefdescription>

testing/100/group___b.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@
3535
<location file="more_100_b.c" line="14" column="1" bodyfile="more_100_b.c" bodystart="14" bodyend="24"/>
3636
</memberdef>
3737
</sectiondef>
38+
<sectiondef kind="typedef">
39+
<memberdef kind="typedef" id="group___b_1ga5a6fd16639bb7ebdbd75952dc246cf51" prot="public" static="no">
40+
<type>struct <ref refid="structs" kindref="compound">s</ref></type>
41+
<definition>typedef struct s T</definition>
42+
<argsstring/>
43+
<name>T</name>
44+
<briefdescription>
45+
<para>T in <ref refid="more__100__b_8c" kindref="compound">more_100_b.c</ref>. </para>
46+
</briefdescription>
47+
<detaileddescription>
48+
</detaileddescription>
49+
<inbodydescription>
50+
</inbodydescription>
51+
<location file="more_100_b.c" line="45" column="16" bodyfile="more_100_b.c" bodystart="45" bodyend="-1"/>
52+
</memberdef>
53+
</sectiondef>
3854
<sectiondef kind="func">
3955
<memberdef kind="function" id="group___b_1gabc536d5f4f9a56b7edcce32ed3a06140" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
4056
<type>void</type>

testing/100/group___c.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<compoundname>C</compoundname>
55
<title>C</title>
66
<innerfile refid="more__100__c_8c">more_100_c.c</innerfile>
7+
<innerclass refid="structs" prot="public">s</innerclass>
78
<briefdescription>
89
</briefdescription>
910
<detaileddescription>

testing/100/structs.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="" xml:lang="en-US">
3+
<compounddef id="structs" kind="struct" language="C++" prot="public">
4+
<compoundname>s</compoundname>
5+
<sectiondef kind="public-attrib">
6+
<memberdef kind="variable" id="structs_1afbd4a62a1d1e5d85ea3fcb5954434f29" prot="public" static="no" mutable="no">
7+
<type>int</type>
8+
<definition>int s::s</definition>
9+
<argsstring/>
10+
<name>s</name>
11+
<qualifiedname>s::s</qualifiedname>
12+
<briefdescription>
13+
<para>Member s. </para>
14+
</briefdescription>
15+
<detaileddescription>
16+
</detaileddescription>
17+
<inbodydescription>
18+
</inbodydescription>
19+
<location file="100_a.c" line="64" column="7" bodyfile="100_a.c" bodystart="64" bodyend="-1"/>
20+
</memberdef>
21+
</sectiondef>
22+
<briefdescription>
23+
<para>Struct s in <ref refid="100__a_8c" kindref="compound">100_a.c</ref>. </para>
24+
</briefdescription>
25+
<detaileddescription>
26+
<para>More for s in <ref refid="100__a_8c" kindref="compound">100_a.c</ref> from <ref refid="more__100__c_8c" kindref="compound">more_100_c.c</ref>. </para>
27+
</detaileddescription>
28+
<location file="100_a.c" line="60" column="1" bodyfile="100_a.c" bodystart="60" bodyend="65"/>
29+
<listofallmembers>
30+
<member refid="structs_1afbd4a62a1d1e5d85ea3fcb5954434f29" prot="public" virt="non-virtual">
31+
<scope>s</scope>
32+
<name>s</name>
33+
</member>
34+
</listofallmembers>
35+
</compounddef>
36+
</doxygen>

testing/100_a.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
!// check: group___a.xml
55
!// check: group___b.xml
66
!// check: group___c.xml
7+
!// check: structs.xml
78

89
/**
910
* @file
@@ -50,3 +51,22 @@ static void f(void) {};
5051
* @ingroup A
5152
*/
5253
void g(void) {};
54+
55+
/**
56+
* @brief Struct s in 100_a.c.
57+
*
58+
* @ingroup A
59+
*/
60+
struct s {
61+
/**
62+
* @brief Member s.
63+
*/
64+
int s;
65+
};
66+
67+
/**
68+
* @brief T in 100_a.c.
69+
*
70+
* @ingroup A
71+
*/
72+
typedef struct s T;

testing/more_100_b.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ enum E {
3636
* @ingroup B
3737
*/
3838
static void f(void) {};
39+
40+
/**
41+
* @brief T in more_100_b.c.
42+
*
43+
* @ingroup B
44+
*/
45+
typedef struct s T;

testing/more_100_c.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,29 @@
125125
*
126126
* More for g() in more_100_a.c from more_100_c.c.
127127
*/
128+
129+
/**
130+
* @struct s
131+
*
132+
* @ingroup A
133+
*
134+
* @ingroup C
135+
*
136+
* More for s in 100_a.c from more_100_c.c.
137+
*/
138+
139+
/**
140+
* @typedef struct s T
141+
*
142+
* @ingroup A
143+
*
144+
* More for T in 100_a.c from more_100_c.c.
145+
*/
146+
147+
/**
148+
* @typedef struct s T
149+
*
150+
* @ingroup B
151+
*
152+
* More for T in more_100_b.c from more_100_c.c.
153+
*/

0 commit comments

Comments
 (0)