Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions common/web/JsonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,12 @@ void JsonTest::testLookups() {
JsonString string1("foo");
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(&string1),
string1.LookupElement(empty_pointer));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
string1.LookupElement(invalid_pointer));

// Now try an object
Expand All @@ -571,7 +576,12 @@ void JsonTest::testLookups() {
object.LookupElement(empty_pointer));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(name_value),
object.LookupElement(name_pointer));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
object.LookupElement(invalid_pointer));

// Now try an array
Expand All @@ -591,17 +601,33 @@ void JsonTest::testLookups() {

OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(array),
array->LookupElement(empty_pointer));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(invalid_pointer));

OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string2),
array->LookupElement(first));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string3),
array->LookupElement(middle));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string4),
array->LookupElement(last));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(one_past_last));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(invalid));

// now a nested case
Expand Down
2 changes: 1 addition & 1 deletion config/resolv.m4
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AC_CHECK_HEADERS([resolv.h])
am_save_LDFLAGS="$LDFLAGS"
RESOLV_LIBS=""

acx_resolv_libs="-lresolv -resolv"
acx_resolv_libs="-lresolv -resolv -lc"
for lib in $acx_resolv_libs; do
acx_resolv_ok=no
LDFLAGS="$am_save_LDFLAGS $lib"
Expand Down
6 changes: 5 additions & 1 deletion ola/AutoStart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ TCPSocket *ConnectToServer(unsigned short port) {
// Try to start the server, we pass --daemon (fork into background) and
// --syslog (log to syslog).
execlp("olad", "olad", "--daemon", "--syslog",
reinterpret_cast<char*>(NULL));
#ifdef __FreeBSD__
reinterpret_cast<char*>(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we align this, and the line below with the ( above please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, with some more occurences :)

#else
reinterpret_cast<char*>(NULL));
#endif // __FreeBSD__
OLA_WARN << "Failed to exec: " << strerror(errno);
_exit(1);
}
Expand Down
54 changes: 45 additions & 9 deletions olad/plugin_api/UniverseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_UNKNOWN_UID,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// ok, now try something that returns a response from the port
request = new ola::rdm::RDMGetRequest(
Expand All @@ -654,7 +658,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_TIMEOUT,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// now try a broadcast fan out
UID vendorcast_uid = UID::VendorcastAddress(0x7a70);
Expand Down Expand Up @@ -683,7 +691,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_WAS_BROADCAST,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// now confirm that if one of the ports fails to send, we see this response
request = new ola::rdm::RDMGetRequest(
Expand All @@ -707,7 +719,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_FAILED_TO_SEND,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// DUB responses are slightly different
request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0);
Expand All @@ -727,7 +743,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_DUB_RESPONSE,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// now check that we still get a RDM_DUB_RESPONSE even if one port returns an
// RDM_TIMEOUT
Expand All @@ -744,7 +764,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_DUB_RESPONSE,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// and the same again but the second port returns
// RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED
Expand All @@ -761,7 +785,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_DUB_RESPONSE,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// now the first port returns a RDM_TIMEOUT
request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0);
Expand All @@ -777,7 +805,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_TIMEOUT,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

// finally if neither ports support the DUB, we should return that
request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0);
Expand All @@ -793,7 +825,11 @@ void UniverseTest::testRDMSend() {
&UniverseTest::ConfirmRDM,
__LINE__,
ola::rdm::RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED,
reinterpret_cast<const RDMResponse*>(NULL)));
#ifdef __FreeBSD__
reinterpret_cast<const RDMResponse*>(0)));
#else
reinterpret_cast<const RDMResponse*>(NULL)));
#endif // __FreeBSD__

universe->RemovePort(&port1);
universe->RemovePort(&port2);
Expand Down