[Scummvm-git-logs] scummvm master -> b8e08ff2a0c3375ae088dfcfb70c6040a42241db
lephilousophe
noreply at scummvm.org
Sun May 19 19:20:16 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c30b68115a TESTS: Abort runner when error is called
b8e08ff2a0 COMMON: Fix Path::baseName
Commit: c30b68115a54316e27404781193eb7a9c3698c3a
https://github.com/scummvm/scummvm/commit/c30b68115a54316e27404781193eb7a9c3698c3a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-05-19T21:17:31+02:00
Commit Message:
TESTS: Abort runner when error is called
By default null backend exits with 0 error code.
Changed paths:
backends/platform/null/null.cpp
test/null_osystem.cpp
diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp
index 4a6c430a7b1..f3f1e4bb55a 100644
--- a/backends/platform/null/null.cpp
+++ b/backends/platform/null/null.cpp
@@ -225,9 +225,11 @@ void OSystem_NULL::getTimeAndDate(TimeDate &td, bool skipRecord) const {
td.tm_wday = t.tm_wday;
}
+#ifndef NULL_DRIVER_USE_FOR_TEST
void OSystem_NULL::quit() {
exit(0);
}
+#endif
void OSystem_NULL::logMessage(LogMessageType::Type type, const char *message) {
if (_silenceLogs)
diff --git a/test/null_osystem.cpp b/test/null_osystem.cpp
index 5c2bc808333..072e7a9e35b 100644
--- a/test/null_osystem.cpp
+++ b/test/null_osystem.cpp
@@ -1,3 +1,5 @@
+#define FORBIDDEN_SYMBOL_EXCEPTION_abort
+
#define USE_NULL_DRIVER 1
#define NULL_DRIVER_USE_FOR_TEST 1
#include "null_osystem.h"
@@ -15,6 +17,10 @@ void Common::install_null_g_system() {
g_system = OSystem_NULL_create(silenceLogs);
}
+void OSystem_NULL::quit() {
+ abort();
+}
+
bool BaseBackend::setScaler(const char *name, int factor) {
return false;
}
Commit: b8e08ff2a0c3375ae088dfcfb70c6040a42241db
https://github.com/scummvm/scummvm/commit/b8e08ff2a0c3375ae088dfcfb70c6040a42241db
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-05-19T21:18:34+02:00
Commit Message:
COMMON: Fix Path::baseName
When baseName was called with a base name path but escaped, unescape was
called with the escaping marker while this is not allowed.
Changed paths:
common/path.cpp
test/common/path.h
diff --git a/common/path.cpp b/common/path.cpp
index 7adad9b59b1..8638f0c8772 100644
--- a/common/path.cpp
+++ b/common/path.cpp
@@ -396,6 +396,9 @@ String Path::baseName() const {
if (separatorPos != String::npos) {
begin += separatorPos + 1;
+ } else if (isEscaped()) {
+ // unescape uses the real start, not the escape marker
+ begin++;
}
end += last;
diff --git a/test/common/path.h b/test/common/path.h
index cfddeced759..e2c44421602 100644
--- a/test/common/path.h
+++ b/test/common/path.h
@@ -89,6 +89,9 @@ class PathTestSuite : public CxxTest::TestSuite
Common::Path p4("parent/dir/file.txt/");
TS_ASSERT_EQUALS(p4.baseName(), "file.txt");
+
+ Common::Path p5("File I/O", ':');
+ TS_ASSERT_EQUALS(p5.baseName(), "File I/O");
}
void test_getParent() {
More information about the Scummvm-git-logs
mailing list