output_option_unittest.cc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 <string>
  15. #include <gtest/gtest.h>
  16. #include <log/output_option.h>
  17. using namespace isc::log;
  18. using namespace std;
  19. /// \brief OutputOption Test
  20. class OutputOptionTest : public ::testing::Test {
  21. public:
  22. OutputOptionTest()
  23. {}
  24. ~OutputOptionTest()
  25. {}
  26. };
  27. // As OutputOption is a struct, the only meaningful test is to check that it
  28. // initializes correctly.
  29. TEST_F(OutputOptionTest, Initialization) {
  30. OutputOption option;
  31. EXPECT_EQ(OutputOption::DEST_CONSOLE, option.destination);
  32. EXPECT_EQ(OutputOption::STR_STDERR, option.stream);
  33. EXPECT_FALSE(option.flush);
  34. EXPECT_EQ(string(""), option.facility);
  35. EXPECT_EQ(string(""), option.filename);
  36. EXPECT_EQ(0, option.maxsize);
  37. EXPECT_EQ(0, option.maxver);
  38. }