diff --git a/src/common/instancehandle.hpp b/src/common/instancehandle.hpp
index d72f4585b..b95b677a7 100644
--- a/src/common/instancehandle.hpp
+++ b/src/common/instancehandle.hpp
@@ -65,7 +65,7 @@ namespace lumiera {
namespace { // implementation details
- void
+ inline void
throwIfError()
{
if (lumiera_error_peek())
@@ -78,7 +78,7 @@ namespace lumiera {
* \em given instance descriptor to open an instance handle.
* @throws error::Config when the registration process fails
*/
- LumieraInterface
+ inline LumieraInterface
register_and_open (LumieraInterface descriptor)
{
if (!descriptor) return NULL;
@@ -93,7 +93,7 @@ namespace lumiera {
/** do a lookup within the interfaceregistry
* using the name/version found within the interface
* handle, to ensure it is still valid and registered */
- bool
+ inline bool
verify_validity (LumieraInterface ifa)
{
REQUIRE (ifa);
@@ -156,9 +156,10 @@ namespace lumiera {
: util::NonCopyable
{
using IH = InstanceHandle;
+
IH& ih_;
- Link (IH& ih)
+ Link(IH& ih)
: ih_{ih}
{ }
@@ -226,7 +227,7 @@ namespace lumiera {
throwIfError();
}
- ~InstanceHandle ()
+ ~InstanceHandle()
{
lumiera_interface_close (&instance_->interface_header_);
if (desc_)
@@ -239,14 +240,14 @@ namespace lumiera {
* @note we don't provide `operator*`
*/
FA*
- operator-> () const
+ operator->() const
{
return facadeLink_.operator ->();
}
/** directly access the instance via the CL interface */
I&
- get () const
+ get() const
{
ENSURE(instance_);
return *instance_;
@@ -270,11 +271,10 @@ namespace lumiera {
isValid() const
{
return instance_
- && verify_validity (&instance_->interface_header_);
+ and verify_validity (&instance_->interface_header_);
}
};
} // namespace lumiera
-
-#endif
+#endif /*LUMIERA_INSTANCEHANDLE_H*/
diff --git a/tests/library/rational-test.cpp b/tests/library/rational-test.cpp
index 4389e3ea4..f3d80a5c3 100644
--- a/tests/library/rational-test.cpp
+++ b/tests/library/rational-test.cpp
@@ -30,6 +30,7 @@
#include "lib/test/run.hpp"
#include "lib/integral.hpp"
#include "lib/format-cout.hpp"
+#include "lib/test/test-helper.hpp"
#include "lib/rational.hpp"
@@ -87,9 +88,9 @@ namespace test {
CHECK (2_r/3 /(3_r/4)== 8_r/9);
CHECK (2_r/3 / 3 /4 == 1_r/18); // usual precedence and brace rules apply, yielding 2/36 here
- CHECK (util::toString(23_r/55) == "23/55sec"); //////////////////////////TICKET #1259 and #1261 : FSecs should really be a distinct (wrapper) type,
- //////////////////////////TICKET #1259 and #1261 : ...then this custom conversion with the suffix "sec" would not kick in here
- CHECK (util::toString(24_r/56) == "3/7sec" ); // rational numbers are normalised and reduced immediately
+ CHECK (util::toString(23_r/55) == "23/55sec"_expect); ///////////////////TICKET #1259 and #1261 : FSecs should really be a distinct (wrapper) type,
+ ///////////////////TICKET #1259 and #1261 : ...then this custom conversion with the suffix "sec" would not kick in here
+ CHECK (util::toString(24_r/56) == "3/7sec"_expect ); // rational numbers are normalised and reduced immediately
CHECK (Rat(10,3).numerator() == int64_t(10));
CHECK (Rat(10,3).denominator() == int64_t(3));
@@ -118,32 +119,32 @@ namespace test {
CHECK (MAXI > 0); // so this one still works
CHECK (MAXI+1 < 0); // but one more and we get a wrap-around
CHECK (MAXI+1 < -MAXI);
- CHECK (util::toString(MAXI) == "9223372036854775807sec"); /////////TICKET #1259 should be "9223372036854775807/1 -- get rid of the "sec" suffix
- CHECK (util::toString(MAXI+1) == "-9223372036854775808sec"); /////////TICKET #1259 should be "-9223372036854775808/1"
- CHECK (util::toString(-MAXI) == "-9223372036854775807sec"); /////////TICKET #1259 should be "-9223372036854775807/1"
+ CHECK (util::toString(MAXI) == "9223372036854775807sec"_expect); /////////TICKET #1259 should be "9223372036854775807/1 -- get rid of the "sec" suffix
+ CHECK (util::toString(MAXI+1) == "-9223372036854775808sec"_expect); /////////TICKET #1259 should be "-9223372036854775808/1"
+ CHECK (util::toString(-MAXI) == "-9223372036854775807sec"_expect); /////////TICKET #1259 should be "-9223372036854775807/1"
CHECK (MINI > 0); // smallest representable number above zero
CHECK (1-MINI < 1);
CHECK (0 < 1-MINI); // can be used below 1 just fine
CHECK (0 > 1+MINI); // but above we get a wrap-around in normalised numerator
- CHECK (util::toString(MINI) == "1/9223372036854775807sec");
- CHECK (util::toString(-MINI) == "-1/9223372036854775807sec");
- CHECK (util::toString(1-MINI) == "9223372036854775806/9223372036854775807sec");
- CHECK (util::toString(1+MINI) == "-9223372036854775808/9223372036854775807sec");
+ CHECK (util::toString(MINI) == "1/9223372036854775807sec"_expect);
+ CHECK (util::toString(-MINI) == "-1/9223372036854775807sec"_expect);
+ CHECK (util::toString(1-MINI) == "9223372036854775806/9223372036854775807sec"_expect);
+ CHECK (util::toString(1+MINI) == "-9223372036854775808/9223372036854775807sec"_expect);
CHECK ((MAXI-1)/MAXI == 1-MINI);
CHECK (MAXI/(MAXI-1) > 1); // as workaround we have to use a slightly larger ULP
CHECK (MAXI/(MAXI-1) - 1 > MINI); // ...this slightly larger one works without wrap-around
CHECK (1 - MAXI/(MAXI-1) < -MINI);
- CHECK (util::toString(MAXI/(MAXI-1)) == "9223372036854775807/9223372036854775806sec");
- CHECK (util::toString(MAXI/(MAXI-1) - 1) == "1/9223372036854775806sec");
- CHECK (util::toString(1 - MAXI/(MAXI-1)) == "-1/9223372036854775806sec");
+ CHECK (util::toString(MAXI/(MAXI-1)) == "9223372036854775807/9223372036854775806sec"_expect);
+ CHECK (util::toString(MAXI/(MAXI-1) - 1) == "1/9223372036854775806sec"_expect);
+ CHECK (util::toString(1 - MAXI/(MAXI-1)) == "-1/9223372036854775806sec"_expect);
// Now entering absolute danger territory....
const Rat MIMI = -MAXI-1; // this is the most extreme negative representable value
CHECK (MIMI < 0);
- CHECK (util::toString(MIMI) == "-9223372036854775808sec"); /////////TICKET #1259 should be "-9223372036854775808/1"
- CHECK (util::toString(1/MIMI) == "-1/-9223372036854775808sec");
+ CHECK (util::toString(MIMI) == "-9223372036854775808sec"_expect); /////////TICKET #1259 should be "-9223372036854775808/1"
+ CHECK (util::toString(1/MIMI) == "-1/-9223372036854775808sec"_expect);
try
{
-1-1/MIMI; // ...but it can't be used for any calculation without blowing up
@@ -354,10 +355,10 @@ namespace test {
CHECK (approx (sleazy+7) == 14);
CHECK (approx (sleazy+9_r/5) == 8.80000019f);
- CHECK (util::toString (poison) == "9223372036854775719/1317624576693539401sec");
- CHECK (util::toString (poison+1) =="-7905747460161236496/1317624576693539401sec");
- CHECK (util::toString (sleazy) == "117440511/16777216sec");
- CHECK (util::toString (sleazy+1) == "134217727/16777216sec");
+ CHECK (util::toString (poison) == "9223372036854775719/1317624576693539401sec"_expect);
+ CHECK (util::toString (poison+1) =="-7905747460161236496/1317624576693539401sec"_expect);
+ CHECK (util::toString (sleazy) == "117440511/16777216sec"_expect);
+ CHECK (util::toString (sleazy+1) == "134217727/16777216sec"_expect);
// also works towards larger denominator, or with negative numbers...
CHECK (reQuant (1/poison, MAX) == 1317624576693539413_r/9223372036854775807);
diff --git a/tests/library/util-floordiv-test.cpp b/tests/library/util-floordiv-test.cpp
index fd720af20..d3a4d57dc 100644
--- a/tests/library/util-floordiv-test.cpp
+++ b/tests/library/util-floordiv-test.cpp
@@ -59,8 +59,8 @@ namespace test {
VecI data;
for (uint i=0; i
+ ...hatte vor einiger Zeit aufgeräumt und einen eigenen #include "lib/integral.hpp" geschaffen. Dadurch ist downstream der #include für time-value.hpp rausgefallen, und damit fehlte die String-conversion für Rationals +
++ ...dazu nochmal über die ganze Problematik nachgedacht und entsprechende Kommentare in #1258 und #1261 hinterlassen +
+ + +