blob: 29cceb1cef1b6a6c275c8a080db6429bc31b3b40 [file] [log] [blame]
Austin Schuh812d0d12021-11-04 20:16:48 -07001// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
Brian Silverman8fce7482020-01-05 13:18:21 -08004
5#include "wpi/hostname.h"
6
7#include "gtest/gtest.h"
8#include "wpi/SmallString.h"
9#include "wpi/SmallVector.h"
10
11namespace wpi {
Austin Schuh812d0d12021-11-04 20:16:48 -070012TEST(HostNameTest, HostNameNotEmpty) {
13 ASSERT_NE(GetHostname(), "");
14}
Brian Silverman8fce7482020-01-05 13:18:21 -080015TEST(HostNameTest, HostNameNotEmptySmallVector) {
16 SmallVector<char, 256> name;
17 ASSERT_NE(GetHostname(name), "");
18}
19TEST(HostNameTest, HostNameEq) {
20 SmallVector<char, 256> nameBuf;
21 ASSERT_EQ(GetHostname(nameBuf), GetHostname());
22}
23} // namespace wpi