Add a bunch of #ifdefs to keep things working as expected on linux

This commit is contained in:
Tyler Wilding
2020-09-03 22:24:50 -04:00
parent f68f220e5b
commit ef09eb12c8
26 changed files with 336 additions and 419 deletions
+28 -25
View File
@@ -942,30 +942,33 @@ TEST(GoosObject, char_to_string) {
EXPECT_EQ("#\\{17}", goos::fixed_to_string(char(17)));
}
///*!
// * Test the EmptyListObject
// */
//TEST(GoosObject, EmptyList) {
// // create two empty lists
// Object nil = EmptyListObject::make_new();
// Object nil2 = EmptyListObject::make_new();
//
// // check type is set
// EXPECT_TRUE(nil.is_empty_list());
//
// // check equality operator
// EXPECT_TRUE(nil == nil2);
//
// // check we get the same heap allocated object
// auto elo = std::dynamic_pointer_cast<EmptyListObject>(nil.heap_obj);
// auto elo2 = std::dynamic_pointer_cast<EmptyListObject>(nil2.heap_obj);
// EXPECT_TRUE(elo);
// EXPECT_TRUE(elo == elo2);
//
// // check print and inspect
// EXPECT_EQ(nil.print(), "()");
// EXPECT_EQ(nil.inspect(), "[empty list] ()\n");
//}
/*!
* Test the EmptyListObject
*/
TEST(GoosObject, EmptyList) {
// TODO-Windows
#ifdef __linux__
// create two empty lists
Object nil = EmptyListObject::make_new();
Object nil2 = EmptyListObject::make_new();
// check type is set
EXPECT_TRUE(nil.is_empty_list());
// check equality operator
EXPECT_TRUE(nil == nil2);
// check we get the same heap allocated object
auto elo = std::dynamic_pointer_cast<EmptyListObject>(nil.heap_obj);
auto elo2 = std::dynamic_pointer_cast<EmptyListObject>(nil2.heap_obj);
EXPECT_TRUE(elo);
EXPECT_TRUE(elo == elo2);
// check print and inspect
EXPECT_EQ(nil.print(), "()");
EXPECT_EQ(nil.inspect(), "[empty list] ()\n");
#endif
}
/*!
* Test IntegerObject
@@ -1286,4 +1289,4 @@ TEST(GoosSpecialForms, And) {
for (auto x : {"(and)"}) {
EXPECT_ANY_THROW(e(i, x));
}
}
}