Add non-Windows helper functions tests.

This commit is contained in:
Oliver Hamlet
2015-07-12 18:37:20 +01:00
parent 97bce1468f
commit 4b68bfe747
3 changed files with 50 additions and 0 deletions
+1
View File
@@ -158,6 +158,7 @@ set (LOOT_TESTS_SRC "${CMAKE_SOURCE_DIR}/src/tests/main.cpp")
set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/fixtures.h"
"${CMAKE_SOURCE_DIR}/src/tests/api/test_api.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/test_game_settings.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/helpers/test_helpers.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/helpers/test_language.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/helpers/test_yaml_set_helpers.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata/test_file.h"
+48
View File
@@ -0,0 +1,48 @@
/* LOOT
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
Fallout: New Vegas.
Copyright (C) 2014-2015 WrinklyNinja
This file is part of LOOT.
LOOT is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
LOOT is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LOOT. If not, see
<http://www.gnu.org/licenses/>.
*/
#ifndef LOOT_TEST_BACKEND_HELPERS
#define LOOT_TEST_BACKEND_HELPERS
#include "backend/helpers/helpers.h"
#include "backend/error.h"
#include "tests/fixtures.h"
class GetCrc32 : public SkyrimTest {};
TEST_F(GetCrc32, MissingFile) {
EXPECT_THROW(loot::GetCrc32(dataPath / "Blank.missing.esp"), loot::error);
}
TEST_F(GetCrc32, ValidFile) {
EXPECT_EQ(0x0B5B7B90, loot::GetCrc32(dataPath / "Blank.esp"));
}
TEST(IntToHexString, PositiveNegativeZeroValues) {
EXPECT_EQ("14", loot::IntToHexString(20));
EXPECT_EQ("-14", loot::IntToHexString(-20));
EXPECT_EQ("0", loot::IntToHexString(0));
}
#endif
+1
View File
@@ -30,6 +30,7 @@
#include "backend/metadata/test_message_content.h"
#include "backend/metadata/test_plugin_dirty_info.h"
#include "backend/metadata/test_tag.h"
#include "backend/helpers/test_helpers.h"
#include "backend/helpers/test_language.h"
#include "backend/helpers/test_yaml_set_helpers.h"