From 0054b0d1dcf1a2d2950cc297b9c595a793827f7a Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 22 Feb 2022 12:54:38 -0500 Subject: Added a unit test for language name mapping --- Makefile | 1 + src/lib/Makefile | 2 +- src/test/testLibbible.cc | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b08ed50..6533081 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ export version = 1.0.1 override CXXFLAGS += -MMD -Wall -std=c++20 +export CXXFLAGS override LDFLAGS += -Lsrc/lib -lbible SOURCES = $(wildcard src/*.cc) OBJECTS = $(SOURCES:.cc=.o) diff --git a/src/lib/Makefile b/src/lib/Makefile index 6b3b506..8084d3f 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -1,5 +1,5 @@ LIBS = sword minizip -override CXXFLAGS += -MMD -Wall -fPIC -std=c++20 `pkg-config $(LIBS) --cflags` +override CXXFLAGS += -fPIC `pkg-config $(LIBS) --cflags` override LDFLAGS += -lstdc++fs `pkg-config $(LIBS) --libs` SOURCES = $(wildcard *.cc) OBJECTS = $(SOURCES:.cc=.o) diff --git a/src/test/testLibbible.cc b/src/test/testLibbible.cc index d3a265a..0f65e6d 100644 --- a/src/test/testLibbible.cc +++ b/src/test/testLibbible.cc @@ -29,6 +29,7 @@ class TestLibbible : public CppUnit::TestFixture CPPUNIT_TEST(testGetPassages); CPPUNIT_TEST(testGetText); CPPUNIT_TEST(testSettings); + CPPUNIT_TEST(testLanguageNames); CPPUNIT_TEST(testDownload); CPPUNIT_TEST_SUITE_END(); @@ -41,6 +42,7 @@ class TestLibbible : public CppUnit::TestFixture void testGetPassages(void); void testGetText(void); void testSettings(void); + void testLanguageNames(void); void testDownload(void); }; @@ -202,6 +204,13 @@ void TestLibbible::testSettings(void) { CPPUNIT_ASSERT(libbible::settingsRead("test") == ""); } +void TestLibbible::testLanguageNames(void) { + std::map langs = libbible::getLanguageNames(); + CPPUNIT_ASSERT(langs["en"] == "English"); + CPPUNIT_ASSERT(langs["es"] == "Spanish"); + CPPUNIT_ASSERT(langs["fr"] == "French"); +} + void TestLibbible::testDownload(void) { map> modsAvailable = libbible::downloadModsAvailable(); // We try installing the first available one -- cgit v1.2.3