mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
As we use the main library of gtest (if already installed) we don't need to (and must not) define a main function for the tests. Does the same (use main library) if we use the subproject.
13 lines
357 B
C++
13 lines
357 B
C++
#include "gtest/gtest.h"
|
|
#include "../include/kiwixserve.h"
|
|
|
|
TEST(KiwixServeTest, PortTest)
|
|
{
|
|
kiwix::KiwixServe kiwixServe("libraryPath", 8181);
|
|
EXPECT_EQ(kiwixServe.getPort(), 8181);
|
|
kiwixServe.setPort(8484);
|
|
EXPECT_EQ(kiwixServe.getPort(), 8484);
|
|
EXPECT_EQ(kiwixServe.setPort(0), -1);
|
|
EXPECT_EQ(kiwixServe.setPort(3456789), -1);
|
|
}
|