summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/test/TestPOUtils.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/test/TestPOUtils.cpp
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/utils/test/TestPOUtils.cpp')
-rw-r--r--xbmc/utils/test/TestPOUtils.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/xbmc/utils/test/TestPOUtils.cpp b/xbmc/utils/test/TestPOUtils.cpp
new file mode 100644
index 0000000..5808c31
--- /dev/null
+++ b/xbmc/utils/test/TestPOUtils.cpp
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#include "test/TestUtils.h"
10#include "utils/POUtils.h"
11
12#include <gtest/gtest.h>
13
14
15TEST(TestPOUtils, General)
16{
17 CPODocument a;
18
19 EXPECT_TRUE(a.LoadFile(XBMC_REF_FILE_PATH("xbmc/utils/test/data/language/Spanish/strings.po")));
20
21 EXPECT_TRUE(a.GetNextEntry());
22 EXPECT_EQ(ID_FOUND, a.GetEntryType());
23 EXPECT_EQ((uint32_t)0, a.GetEntryID());
24 a.ParseEntry(false);
25 EXPECT_STREQ("", a.GetMsgctxt().c_str());
26 EXPECT_STREQ("Programs", a.GetMsgid().c_str());
27 EXPECT_STREQ("Programas", a.GetMsgstr().c_str());
28 EXPECT_STREQ("", a.GetPlurMsgstr(0).c_str());
29
30 EXPECT_TRUE(a.GetNextEntry());
31 EXPECT_EQ(ID_FOUND, a.GetEntryType());
32 EXPECT_EQ((uint32_t)1, a.GetEntryID());
33 a.ParseEntry(false);
34 EXPECT_STREQ("", a.GetMsgctxt().c_str());
35 EXPECT_STREQ("Pictures", a.GetMsgid().c_str());
36 EXPECT_STREQ("Imágenes", a.GetMsgstr().c_str());
37 EXPECT_STREQ("", a.GetPlurMsgstr(0).c_str());
38
39 EXPECT_TRUE(a.GetNextEntry());
40 EXPECT_EQ(ID_FOUND, a.GetEntryType());
41 EXPECT_EQ((uint32_t)2, a.GetEntryID());
42 a.ParseEntry(false);
43 EXPECT_STREQ("", a.GetMsgctxt().c_str());
44 EXPECT_STREQ("Music", a.GetMsgid().c_str());
45 EXPECT_STREQ("Música", a.GetMsgstr().c_str());
46 EXPECT_STREQ("", a.GetPlurMsgstr(0).c_str());
47}