Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 1 | // 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 Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 4 | |
| 5 | #include "wpi/hostname.h" |
| 6 | |
| 7 | #include "gtest/gtest.h" |
| 8 | #include "wpi/SmallString.h" |
| 9 | #include "wpi/SmallVector.h" |
| 10 | |
| 11 | namespace wpi { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 12 | TEST(HostNameTest, HostNameNotEmpty) { |
| 13 | ASSERT_NE(GetHostname(), ""); |
| 14 | } |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 15 | TEST(HostNameTest, HostNameNotEmptySmallVector) { |
| 16 | SmallVector<char, 256> name; |
| 17 | ASSERT_NE(GetHostname(name), ""); |
| 18 | } |
| 19 | TEST(HostNameTest, HostNameEq) { |
| 20 | SmallVector<char, 256> nameBuf; |
| 21 | ASSERT_EQ(GetHostname(nameBuf), GetHostname()); |
| 22 | } |
| 23 | } // namespace wpi |