Browse Source

Fixed namespace

develop
Robin Thoni 6 years ago
parent
commit
f33ee1690a
3 changed files with 10 additions and 11 deletions
  1. 1
    1
      src/modules/dns/includes/dns/QDnsHeader.h
  2. 1
    1
      src/modules/dns/src/QDnsHeader.cpp
  3. 8
    9
      tests/main.cpp

+ 1
- 1
src/modules/dns/includes/dns/QDnsHeader.h View File

@@ -8,7 +8,7 @@
8 8
 #include <qplatformdefs.h>
9 9
 #include <QByteArray>
10 10
 
11
-namespace QDNS
11
+namespace QDns
12 12
 {
13 13
 
14 14
     class QDnsHeader

+ 1
- 1
src/modules/dns/src/QDnsHeader.cpp View File

@@ -5,7 +5,7 @@
5 5
 #include <QDataStream>
6 6
 #include "dns/QDnsHeader.h"
7 7
 
8
-namespace QDNS
8
+namespace QDns
9 9
 {
10 10
 
11 11
     QDnsHeader::QDnsHeader()

+ 8
- 9
tests/main.cpp View File

@@ -1,7 +1,6 @@
1 1
 #include <gtest/gtest.h>
2 2
 #include <QByteArray>
3 3
 #include <QString>
4
-#include <QtCore/QDataStream>
5 4
 
6 5
 #include "dns/QDnsHeader.h"
7 6
 
@@ -37,7 +36,7 @@ TEST_P(DNSHeaderTest, parseAndGetters)
37 36
 {
38 37
     auto params = GetParam();
39 38
     auto data = QByteArray::fromHex(params.hexData);
40
-    auto header = QDNS::QDnsHeader::parse(data);
39
+    auto header = QDns::QDnsHeader::parse(data);
41 40
     ASSERT_EQ(header.isValid(), params.isValid);
42 41
 
43 42
     if (header.isValid())
@@ -74,7 +73,7 @@ TEST_P(DNSHeaderTest, settersAndGetters1)
74 73
     }
75 74
 
76 75
     auto data = QByteArray::fromHex(params.hexData);
77
-    QDNS::QDnsHeader header;
76
+    QDns::QDnsHeader header;
78 77
 
79 78
     header.setId(params.id);
80 79
     header.setFlags(params.flags);
@@ -114,7 +113,7 @@ TEST_P(DNSHeaderTest, settersAndGetters2)
114 113
     }
115 114
 
116 115
     auto data = QByteArray::fromHex(params.hexData);
117
-    QDNS::QDnsHeader header;
116
+    QDns::QDnsHeader header;
118 117
 
119 118
     header.setId(params.id);
120 119
     header.setIsQuery(params.flagQuery);
@@ -244,7 +243,7 @@ INSTANTIATE_TEST_CASE_P(DNSHeaderTestInst,
244 243
 
245 244
 TEST(DNSHeaderTest, getFlagBits)
246 245
 {
247
-    QDNS::QDnsHeader header;
246
+    QDns::QDnsHeader header;
248 247
 
249 248
     header.setFlags(0x5555);
250 249
     ASSERT_EQ(header.getFlagBits(0, 1), 0);
@@ -253,10 +252,10 @@ TEST(DNSHeaderTest, getFlagBits)
253 252
 
254 253
 TEST(DNSHeaderTest, getFlagBitIndex)
255 254
 {
256
-    ASSERT_EQ(QDNS::QDnsHeader::getFlagBitIndex(0), 15);
257
-    ASSERT_EQ(QDNS::QDnsHeader::getFlagBitIndex(1), 14);
258
-    ASSERT_EQ(QDNS::QDnsHeader::getFlagBitIndex(14), 1);
259
-    ASSERT_EQ(QDNS::QDnsHeader::getFlagBitIndex(15), 0);
255
+    ASSERT_EQ(QDns::QDnsHeader::getFlagBitIndex(0), 15);
256
+    ASSERT_EQ(QDns::QDnsHeader::getFlagBitIndex(1), 14);
257
+    ASSERT_EQ(QDns::QDnsHeader::getFlagBitIndex(14), 1);
258
+    ASSERT_EQ(QDns::QDnsHeader::getFlagBitIndex(15), 0);
260 259
 }
261 260
 
262 261
 int main(int argc, char* argv[])

Loading…
Cancel
Save