blob: d5ec5353e8c87b51866789f2e2575a543ce66395 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "wpi/hostname.h"
9
10#include "gtest/gtest.h"
11#include "wpi/SmallString.h"
12#include "wpi/SmallVector.h"
13
14namespace wpi {
15TEST(HostNameTest, HostNameNotEmpty) { ASSERT_NE(GetHostname(), ""); }
16TEST(HostNameTest, HostNameNotEmptySmallVector) {
17 SmallVector<char, 256> name;
18 ASSERT_NE(GetHostname(name), "");
19}
20TEST(HostNameTest, HostNameEq) {
21 SmallVector<char, 256> nameBuf;
22 ASSERT_EQ(GetHostname(nameBuf), GetHostname());
23}
24} // namespace wpi