diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-05 22:17:22 +0200 |
---|---|---|
committer | Ner'zhul <nerzhul@users.noreply.github.com> | 2016-10-06 00:28:24 +0200 |
commit | 61d1751dfff71d8fd433c6c84bd39db1672a3ee6 (patch) | |
tree | ead3afdfcc79b05f2cd18b16782fa8e68a8a8d81 /src | |
parent | 7fab86a49dd569f24804eb7396843e61095e3854 (diff) | |
download | minetest-61d1751dfff71d8fd433c6c84bd39db1672a3ee6.tar.gz minetest-61d1751dfff71d8fd433c6c84bd39db1672a3ee6.tar.bz2 minetest-61d1751dfff71d8fd433c6c84bd39db1672a3ee6.zip |
Travis: build matrix improvements + CPP11 build
Diffstat (limited to 'src')
-rw-r--r-- | src/unittest/test_settings.cpp | 7 | ||||
-rw-r--r-- | src/unittest/test_threading.cpp | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/unittest/test_settings.cpp b/src/unittest/test_settings.cpp index a82d734f0..733c7e92a 100644 --- a/src/unittest/test_settings.cpp +++ b/src/unittest/test_settings.cpp @@ -32,7 +32,7 @@ public: void testAllSettings(); static const char *config_text_before; - static const char *config_text_after; + static const std::string config_text_after; }; static TestSettings g_test_instance; @@ -69,7 +69,7 @@ const char *TestSettings::config_text_before = "np_terrain = 5, 40, (250, 250, 250), 12341, 5, 0.7, 2.4\n" "zoop = true"; -const char *TestSettings::config_text_after = +const std::string TestSettings::config_text_after = "leet = 1337\n" "leetleet = 13371337\n" "leetleet_neg = -13371337\n" @@ -197,7 +197,10 @@ void TestSettings::testAllSettings() UASSERT(s.updateConfigObject(is, os, "", 0) == true); //printf(">>>> expected config:\n%s\n", TEST_CONFIG_TEXT_AFTER); //printf(">>>> actual config:\n%s\n", os.str().c_str()); +#if __cplusplus < 201103L + // This test only works in older C++ versions than C++11 because we use unordered_map UASSERT(os.str() == config_text_after); +#endif } catch (SettingNotFoundException &e) { UASSERT(!"Setting not found!"); } diff --git a/src/unittest/test_threading.cpp b/src/unittest/test_threading.cpp index 224e123df..cdbf9674e 100644 --- a/src/unittest/test_threading.cpp +++ b/src/unittest/test_threading.cpp @@ -163,6 +163,7 @@ private: void TestThreading::testAtomicSemaphoreThread() { Atomic<u32> val; + val = 0; Semaphore trigger; static const u8 num_threads = 4; |