dns_test.cc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #include <acl/dns.h>
  15. #include <gtest/gtest.h>
  16. using namespace isc::acl::dns;
  17. namespace {
  18. // Tests that the getLoader actually returns something, returns the same every
  19. // time and the returned value can be used to anything. It is not much of a
  20. // test, but the getLoader is not much of a function.
  21. TEST(DNSACL, getLoader) {
  22. Loader* l(&getLoader());
  23. ASSERT_TRUE(l != NULL);
  24. EXPECT_EQ(l, &getLoader());
  25. EXPECT_NO_THROW(l->load(isc::data::Element::fromJSON(
  26. "[{\"action\": \"DROP\"}]")));
  27. // TODO Test that the things we should register by default, like IP based
  28. // check, are loaded.
  29. }
  30. }