Files
allwpilib/wpiutil/src/test/native/cpp/hostname.cpp

24 lines
658 B
C++
Raw Normal View History

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
2017-08-27 21:35:34 -07:00
#include "wpi/hostname.h"
2017-08-27 21:35:34 -07:00
#include "gtest/gtest.h"
#include "wpi/SmallString.h"
#include "wpi/SmallVector.h"
2017-08-27 21:35:34 -07:00
namespace wpi {
TEST(HostNameTest, HostNameNotEmpty) {
ASSERT_NE(GetHostname(), "");
}
2017-08-27 21:35:34 -07:00
TEST(HostNameTest, HostNameNotEmptySmallVector) {
SmallVector<char, 256> name;
ASSERT_NE(GetHostname(name), "");
2017-08-27 21:35:34 -07:00
}
TEST(HostNameTest, HostNameEq) {
SmallVector<char, 256> nameBuf;
ASSERT_EQ(GetHostname(nameBuf), GetHostname());
}
2017-08-27 21:35:34 -07:00
} // namespace wpi