Brian Silverman | 41cdd3e | 2019-01-19 19:48:58 -0800 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 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 | |
| 14 | namespace wpi { |
| 15 | TEST(HostNameTest, HostNameNotEmpty) { ASSERT_NE(GetHostname(), ""); } |
| 16 | TEST(HostNameTest, HostNameNotEmptySmallVector) { |
| 17 | SmallVector<char, 256> name; |
| 18 | ASSERT_NE(GetHostname(name), ""); |
| 19 | } |
| 20 | TEST(HostNameTest, HostNameEq) { |
| 21 | SmallVector<char, 256> nameBuf; |
| 22 | ASSERT_EQ(GetHostname(nameBuf), GetHostname()); |
| 23 | } |
| 24 | } // namespace wpi |