Adapt Exception test to emcc/Clang versions that support std::source_location

...so that the Exception's Message is something like "error at
unotest/source/embindtest/embindtest.cxx:271" instead of just plain "error"

Change-Id: I3b236dc91cc75f859000a2283f04413fcbbd6b39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164470
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This commit is contained in:
Stephan Bergmann 2024-03-06 14:55:37 +01:00
parent 3172945445
commit 119696c73e
2 changed files with 2 additions and 2 deletions

View file

@ -279,7 +279,7 @@ class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest>
return false;
}
auto const& e = *o3tl::forceAccess<org::libreoffice::embindtest::Exception>(value);
return e.Message == "error" && !e.Context.is() && e.m1 == -123456 && e.m2 == 100.5
return e.Message.startsWith("error") && !e.Context.is() && e.m1 == -123456 && e.m2 == 100.5
&& e.m3 == u"";
}

View file

@ -289,7 +289,7 @@ Module.addOnPostRun(function() {
{
let v = test.getAnyException();
console.log(v);
console.assert(v.get().Message === 'error');
console.assert(v.get().Message.startsWith('error'));
console.assert(v.get().Context === null);
console.assert(v.get().m1 === -123456);
console.assert(v.get().m2 === 100.5);