copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/common/queue_testutils.cc b/aos/common/queue_testutils.cc
new file mode 100644
index 0000000..6cce012
--- /dev/null
+++ b/aos/common/queue_testutils.cc
@@ -0,0 +1,26 @@
+#include "aos/common/queue_testutils.h"
+#include "aos/common/queue.h"
+
+namespace aos {
+namespace common {
+namespace testing {
+
+GlobalCoreInstance::GlobalCoreInstance() {
+ const size_t kCoreSize = 0x100000;
+ global_core = &global_core_data_;
+ global_core->owner = 1;
+ void *memory = malloc(kCoreSize);
+ assert(memory != NULL);
+ memset(memory, 0, kCoreSize);
+
+ assert(aos_core_use_address_as_shared_mem(memory, kCoreSize) == 0);
+}
+
+GlobalCoreInstance::~GlobalCoreInstance() {
+ free(global_core->mem_struct);
+ global_core = NULL;
+}
+
+} // namespace testing
+} // namespace common
+} // namespace aos