Skip to content
Snippets Groups Projects
Commit 8d1ace41 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Fixing a few issues with librts build on MacOS

parent 3e0942bf
No related branches found
No related tags found
1 merge request!646Fixing a few issues with librts build on MacOS
......@@ -6,7 +6,11 @@
#include "controller.h"
#include "drv/rts-logger.h"
#ifdef __KERNEL__
#include <linux/string.h>
#else
#include <string.h>
#endif
// IOP models can map more hardware than an individual control model uses.
// This means that the DACs, ADCs, etc might be sparsely distributed
......@@ -348,4 +352,4 @@ void initmap(CDS_HARDWARE* pCds)
void unmapPciModules(CDS_HARDWARE* pCds)
{
return;
}
\ No newline at end of file
}
......@@ -141,7 +141,8 @@ static inline uint64_t timer_end_ns( LIGO_DUR_t * start)
static inline void udelay( int us)
{
struct timespec sleeptime={.tv_sec=0, .tv_nsec=us*1000};//us to ns
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &sleeptime, NULL);
//clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &sleeptime, NULL);
nanosleep(&sleeptime, NULL);
}
......
......@@ -19,7 +19,11 @@ TEST_CASE ("mux matrix", "[general]" )
std::feclearexcept(FE_ALL_EXCEPT);
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
REQUIRE( model_ptr->set_var(TEST_SUBSYSTEM "MUXMATRIX_IN_1", 1) );
REQUIRE( model_ptr->set_var(TEST_SUBSYSTEM "MUXMATRIX_IN_2", 1) );
......@@ -44,7 +48,10 @@ TEST_CASE ("mux matrix", "[general]" )
REQUIRE(out.value().back() == Approx(2.0));
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
}
......@@ -88,9 +95,10 @@ TEST_CASE ("filter matrix", "[general]" )
REQUIRE(out.value().back() == Approx(2.0));
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
}
......@@ -104,7 +112,9 @@ TEST_CASE( "ramp mux matrix tests", "[general]" )
model_ptr->run_model( model_ptr->get_model_rate_Hz() * 1);
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
REQUIRE( model_ptr->set_var(TEST_SUBSYSTEM "RAMPMUXMATRIX_IN_1", 10) );
......@@ -140,8 +150,10 @@ TEST_CASE( "ramp mux matrix tests", "[general]" )
REQUIRE(out);
REQUIRE(out.value().back() != 0.0);
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
}
......@@ -155,8 +167,9 @@ TEST_CASE( "ramp mux matrix 1 tests", "[general]" )
model_ptr->run_model( model_ptr->get_model_rate_Hz() * 1);
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
REQUIRE( model_ptr->set_var(TEST_SUBSYSTEM "RAMPMUXMATRIX1_IN_1", 10) );
......@@ -239,8 +252,9 @@ TEST_CASE( "ramp mux matrix 1 tests", "[general]" )
model_ptr->run_model( model_ptr->get_model_rate_Hz() * 6);
#if defined(__x86_64__)
REQUIRE(std::fetestexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) == 0);
#endif
}
......
......@@ -45,7 +45,8 @@ TEST_CASE( "Test the statespace part", "[statespace]" )
//Verify we have settled to around 0
model_ptr->run_model( 1 );
REQUIRE( model_ptr->get_var<double>("STATESPACE_TEST_1_1_OUT") == Approx( 0.0 ) );
REQUIRE( model_ptr->get_var<double>("STATESPACE_TEST_1_1_OUT").value_or(-1000) < 0.0001 );
REQUIRE( model_ptr->get_var<double>("STATESPACE_TEST_1_1_OUT").value_or(-1000) > -0.0001 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment