File: test-dnsparser_hh.cc

package info (click to toggle)
pdns-recursor 5.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,108 kB
  • sloc: cpp: 109,513; javascript: 20,651; python: 5,657; sh: 5,069; makefile: 780; ansic: 582; xml: 37
file content (24 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef BOOST_TEST_DYN_LINK
#define BOOST_TEST_DYN_LINK
#endif

#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()