config_report_unittests.cc 846 Bytes
Newer Older
1 2
// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
//
3 4 5
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 7

#include <config.h>
8
#include <kea_version.h>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#include <cfgrpt/config_report.h>

#include <gtest/gtest.h>

using namespace isc;
using namespace std;

// This test verifies that the getConfigReport() function
// returns the actual config report.
TEST(ConfigReportTest, getConfigReport) {

    // Fetch the report string
    std::string cfgReport = isc::detail::getConfigReport();

    // Verify that it is not empty and does contain the
    // extended version number
    ASSERT_FALSE(cfgReport.empty());
    EXPECT_NE(std::string::npos, cfgReport.find(EXTENDED_VERSION, 0));
}