Merge lp:~michihenning/unity-api/fix-version into lp:unity-api

Proposed by Michi Henning
Status: Merged
Approved by: Jussi Pakkanen
Approved revision: 52
Merged at revision: 52
Proposed branch: lp:~michihenning/unity-api/fix-version
Merge into: lp:unity-api
Diff against target: 168 lines (+56/-51)
3 files modified
include/unity/api/Version.h.in (+52/-43)
src/unity/api/Version.cpp (+0/-4)
test/gtest/unity/api/Version/Version_test.cpp (+4/-4)
To merge this branch: bzr merge lp:~michihenning/unity-api/fix-version
Reviewer Review Type Date Requested Status
Jussi Pakkanen (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+167677@code.launchpad.net

Commit message

Removed Version class and hoisted version functions into unity::api namespace. Fixed doc accordingly.

Description of the change

Removed Version class and hoisted version functions into unity::api namespace. Fixed doc accordingly.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Yes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/api/Version.h.in'
2--- include/unity/api/Version.h.in 2013-05-16 11:48:42 +0000
3+++ include/unity/api/Version.h.in 2013-06-06 01:08:29 +0000
4@@ -31,14 +31,19 @@
5
6 #define UNITY_API_VERSION_STRING "@UNITY_API_VERSION@"
7
8+/**
9+\brief Top-level namespace for all things Unity-related.
10+*/
11 namespace unity
12 {
13
14+/**
15+\brief Top-level namespace for public functionality of the Unity API.
16+*/
17 namespace api
18 {
19
20-/**
21-\brief Class to obtain version information for the Unity API at run time.
22+/** @name Version information
23
24 Version information is represented as
25 <i>&lt;<code>major</code>&gt;</i>.<i>&lt;<code>minor</code>&gt;</i>.<i>&lt;<code>micro</code>&gt;</i>.
26@@ -53,47 +58,51 @@
27 Changes in the minor version indicate feature additions that are binary compatible.
28 */
29
30-// Version could be a namespace instead of a class, but that requires a lower-case name,
31-// which is inconsistent with the remainder of the API.
32-
33-class UNITY_API Version
34-{
35-public:
36- /**
37- \brief Returns the major version number of the Unity API library.
38-
39- The major version number is also available as the macro <code>UNITY_API_VERSION_MAJOR</code>.
40- */
41- static int major_version();
42-
43- /**
44- \brief Returns the minor version number of the Unity API library.
45-
46- The minor version number is also available as the macro <code>UNITY_API_VERSION_MINOR</code>.
47- */
48- static int minor_version();
49-
50- /**
51- \brief Returns the micro version number of the Unity API library.
52-
53- The micro version number is also available as the macro <code>UNITY_API_VERSION_MICRO</code>.
54- */
55- static int micro_version();
56-
57- /**
58- \brief Returns the Unity API version as a string in the format
59- <i>&lt;<code>major</code>&gt;</i>.<i>&lt;<code>minor</code>&gt;</i>.<i>&lt;<code>micro</code>&gt;</i>.
60-
61- The version string is also available as the macro <code>UNITY_API_VERSION_STRING</code>.
62- */
63- static const char* str(); // Returns "major.minor.micro"
64-
65- // TODO: Add methods to report compiler version and compiler flags
66-
67-private:
68- Version() = delete;
69- ~Version() = delete;
70-};
71+/**
72+\brief Returns the major version number of the Unity API library.
73+
74+The major version number is also available as the macro <code>UNITY_API_VERSION_MAJOR</code>.
75+*/
76+
77+/// @cond
78+UNITY_API
79+/// @endcond
80+int major_version();
81+
82+/**
83+\brief Returns the minor version number of the Unity API library.
84+
85+The minor version number is also available as the macro <code>UNITY_API_VERSION_MINOR</code>.
86+*/
87+/// @cond
88+UNITY_API
89+/// @endcond
90+int minor_version();
91+
92+/**
93+\brief Returns the micro version number of the Unity API library.
94+
95+The micro version number is also available as the macro <code>UNITY_API_VERSION_MICRO</code>.
96+*/
97+/// @cond
98+UNITY_API
99+/// @endcond
100+int micro_version();
101+
102+/**
103+\brief Returns the Unity API version as a string in the format
104+<i>&lt;<code>major</code>&gt;</i>.<i>&lt;<code>minor</code>&gt;</i>.<i>&lt;<code>micro</code>&gt;</i>.
105+
106+The version string is also available as the macro <code>UNITY_API_VERSION_STRING</code>.
107+*/
108+/// @cond
109+UNITY_API
110+/// @endcond
111+const char* str(); // Returns "major.minor.micro"
112+
113+/// }@
114+
115+// TODO: Add methods to report compiler version and compiler flags
116
117 } // namespace api
118
119
120=== modified file 'src/unity/api/Version.cpp'
121--- src/unity/api/Version.cpp 2013-03-14 12:25:53 +0000
122+++ src/unity/api/Version.cpp 2013-06-06 01:08:29 +0000
123@@ -27,28 +27,24 @@
124 {
125
126 int
127-Version::
128 major_version()
129 {
130 return UNITY_API_VERSION_MAJOR;
131 }
132
133 int
134-Version::
135 minor_version()
136 {
137 return UNITY_API_VERSION_MINOR;
138 }
139
140 int
141-Version::
142 micro_version()
143 {
144 return UNITY_API_VERSION_MICRO;
145 }
146
147 char const*
148-Version::
149 str()
150 {
151 return UNITY_API_VERSION_STRING;
152
153=== modified file 'test/gtest/unity/api/Version/Version_test.cpp'
154--- test/gtest/unity/api/Version/Version_test.cpp 2013-03-14 12:25:53 +0000
155+++ test/gtest/unity/api/Version/Version_test.cpp 2013-06-06 01:08:29 +0000
156@@ -24,8 +24,8 @@
157
158 TEST(Version, basic)
159 {
160- EXPECT_EQ(Version::major_version(), UNITY_API_VERSION_MAJOR);
161- EXPECT_EQ(Version::minor_version(), UNITY_API_VERSION_MINOR);
162- EXPECT_EQ(Version::micro_version(), UNITY_API_VERSION_MICRO);
163- EXPECT_STREQ(Version::str(), UNITY_API_VERSION_STRING);
164+ EXPECT_EQ(major_version(), UNITY_API_VERSION_MAJOR);
165+ EXPECT_EQ(minor_version(), UNITY_API_VERSION_MINOR);
166+ EXPECT_EQ(micro_version(), UNITY_API_VERSION_MICRO);
167+ EXPECT_STREQ(str(), UNITY_API_VERSION_STRING);
168 }

Subscribers

People subscribed via source and target branches

to all changes: