File: test-dnsparser_hh.cc

package info (click to toggle)
pdns-recursor 4.1.11-1+deb10u1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 7,936 kB
  • sloc: cpp: 54,211; javascript: 26,587; sh: 11,872; makefile: 453; xml: 37
file content (21 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_NO_MAIN
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <boost/test/unit_test.hpp>
#include "dnsparser.hh"

BOOST_AUTO_TEST_SUITE(test_dnsparser_hh)

BOOST_AUTO_TEST_CASE(test_type_lowercase) {
  std::string lc("type12345");
  std::string uc("TYPE12345");

  uint16_t lc_result = DNSRecordContent::TypeToNumber(lc);
  uint16_t uc_result = DNSRecordContent::TypeToNumber(uc);
  BOOST_CHECK_EQUAL(lc_result, 12345);
  BOOST_CHECK_EQUAL(lc_result, uc_result);
}

BOOST_AUTO_TEST_SUITE_END()