2020-12-26 14:12:05 -08:00
|
|
|
// 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
|
|
|
|
2022-05-07 10:54:14 -07:00
|
|
|
#include "wpinet/hostname.h"
|
|
|
|
|
|
|
|
|
|
#include <wpi/SmallString.h>
|
|
|
|
|
#include <wpi/SmallVector.h>
|
2017-08-27 21:35:34 -07:00
|
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
namespace wpi {
|
2020-12-28 12:58:06 -08:00
|
|
|
TEST(HostNameTest, HostNameNotEmpty) {
|
|
|
|
|
ASSERT_NE(GetHostname(), "");
|
|
|
|
|
}
|
2017-08-27 21:35:34 -07:00
|
|
|
TEST(HostNameTest, HostNameNotEmptySmallVector) {
|
2018-04-29 23:33:19 -07:00
|
|
|
SmallVector<char, 256> name;
|
|
|
|
|
ASSERT_NE(GetHostname(name), "");
|
2017-08-27 21:35:34 -07:00
|
|
|
}
|
2018-10-28 19:01:48 -07:00
|
|
|
TEST(HostNameTest, HostNameEq) {
|
|
|
|
|
SmallVector<char, 256> nameBuf;
|
|
|
|
|
ASSERT_EQ(GetHostname(nameBuf), GetHostname());
|
|
|
|
|
}
|
2017-08-27 21:35:34 -07:00
|
|
|
} // namespace wpi
|