TBR Fix paypal/gatt so mac tests pass

Change-Id: Ifa5b88074dc6d34b6230ca9e849afbe2c81972a3
diff --git a/csrc/crosstool-ng-1.19.0/contrib/gcc-test-suite/Makefile b/csrc/crosstool-ng-1.19.0/contrib/gcc-test-suite/Makefile
new file mode 100644
index 0000000..edf5806
--- /dev/null
+++ b/csrc/crosstool-ng-1.19.0/contrib/gcc-test-suite/Makefile
@@ -0,0 +1,79 @@
+# Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
+#
+# Note: Before run please make sure to have your toolchain available in your path.
+#
+# Copyright 2010 DoréDevelopment
+# 
+# Author: Martin Lund <mgl@doredevelopment.dk>
+#
+# This program is free software; you can redistribute  it and/or modify it
+# under  the terms of  the GNU General  Public License as published by the
+# Free Software Foundation;  either version 2 of the  License, or (at your
+# option) any later version.
+#
+
+# Internal configuration
+TARGET:=@@DG_TARGET@@
+TOPDIR:=$(shell pwd)
+LOGDIR:=$(TOPDIR)/tmp
+
+# Include default configuration
+include default.cfg
+
+# Add toolchain to path
+PATH:=$(shell cd ../../bin && pwd):$(PATH)
+
+# Select test set
+ifeq ($(DG_TOOLNAME),gcc)
+	DG_TESTS:=$(DG_C_TESTS)
+endif
+ifeq ($(DG_TOOLNAME),g++)
+	DG_TESTS:=$(DG_CPP_TESTS)
+endif
+
+# Check that we have 'runtest' installed
+RUNTEST=$(shell which runtest)
+ifeq ($(RUNTEST),)
+        $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
+endif
+
+# Targets 
+all: test
+
+$(LOGDIR):
+	@mkdir -p $@
+
+$(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR)
+	@{ echo 'lappend boards_dir "$(LOGDIR)"'; \
+	   echo 'set target_alias $(TARGET)';     } > $@
+
+$(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR)
+	@{ echo 'load_generic_config "unix"';                    \
+	   echo 'process_multilib_options ""';                   \
+	   echo 'set_board_info bmk,use_alarm 1';                \
+	   echo 'set_board_info rsh_prog ssh';                   \
+	   echo 'set_board_info rcp_prog scp';                   \
+	   echo 'set_board_info hostname $(DG_TARGET_HOSTNAME)'; \
+	   echo 'set_board_info username $(DG_TARGET_USERNAME)'; } > $@
+
+# As Martin puts it:
+#  > The thing is that when you run 50k+ test cases the odds are that at
+#  > least one will fail and thus runtest basically always return an error
+#  > despite the fact that the test session has executed successfully.
+# So just ignore any error reported by runtest
+test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR)
+	@runtest --tool $(DG_TOOLNAME)          \
+	         --srcdir $(TOPDIR)/testsuite   \
+	         --objdir $(LOGDIR)             \
+	         --outdir $(LOGDIR)             \
+	         --all                          \
+	         --target $(TARGET)             \
+	         --target_board board           \
+	         $(DG_TESTS)                    \
+	         GXX_UNDER_TEST=$(TARGET)-g++   || true
+	@printf "Result files available in '%s'\n" "$(LOGDIR)"
+
+clean:
+	rm -rf $(LOGDIR)
+
+.PHONY: config test clean
diff --git a/go/src/github.com/paypal/gatt/xpc/xpc_darwin_test.go b/go/src/github.com/paypal/gatt/xpc/xpc_darwin_test.go
index fa05930..6bf862e 100644
--- a/go/src/github.com/paypal/gatt/xpc/xpc_darwin_test.go
+++ b/go/src/github.com/paypal/gatt/xpc/xpc_darwin_test.go
@@ -1,6 +1,7 @@
 package xpc
 
 import (
+	"reflect"
 	"testing"
 )
 
@@ -23,7 +24,7 @@
 
 	uuid2 := CheckUUID(t, v)
 
-	if uuid != uuid2 {
+	if reflect.DeepEqual(uuid, uuid2) {
 		t.Errorf("expected %#v got %#v\n", uuid, uuid2)
 	}
 }
@@ -36,7 +37,7 @@
 
 	xpc_release(xv)
 
-	if arr2, ok := v.(array); !ok {
+	if arr2, ok := v.(Array); !ok {
 		t.Errorf("not an array: %#v\n", v)
 	} else if len(arr) != len(arr2) {
 		t.Errorf("expected %#v got %#v\n", arr, arr2)
@@ -57,7 +58,7 @@
 
 	xpc_release(xv)
 
-	if arr2, ok := v.(array); !ok {
+	if arr2, ok := v.(Array); !ok {
 		t.Errorf("not an array: %#v\n", v)
 	} else if len(arr) != len(arr2) {
 		t.Errorf("expected %#v got %#v\n", arr, arr2)
@@ -66,7 +67,7 @@
 			uuid1 := CheckUUID(t, arr[i])
 			uuid2 := CheckUUID(t, arr2[i])
 
-			if uuid1 != uuid2 {
+			if reflect.DeepEqual(uuid1, uuid2) {
 				t.Errorf("expected array[%d]: %#v got %#v\n", i, arr[i], arr2[i])
 			}
 		}
@@ -74,7 +75,7 @@
 }
 
 func TestConvertMap(t *testing.T) {
-	d := dict{
+	d := Dict{
 		"number": int64(42),
 		"text":   "hello gopher",
 		"uuid":   MakeUUID("aabbccddeeff00112233445566778899"),
@@ -85,7 +86,7 @@
 
 	xpc_release(xv)
 
-	if d2, ok := v.(dict); !ok {
+	if d2, ok := v.(Dict); !ok {
 		t.Errorf("not a map: %#v", v)
 	} else if len(d) != len(d2) {
 		t.Errorf("expected %#v got %#v\n", d, d2)