[gnome-bluetooth] lib: Add test case for pin code generation



commit 4d12df875bbcf6759f1359f3b7a1a951a5029963
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 9 15:23:59 2013 +0100

    lib: Add test case for pin code generation

 lib/Makefile.am |    5 ++++-
 lib/test-pin.c  |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7dad198..9714c11 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -115,7 +115,7 @@ BUILT_SOURCES += bluetooth-client-glue.h \
 
 CLEANFILES += $(BUILT_SOURCES)
 
-noinst_PROGRAMS = test-client test-agent test-deviceselection test-class test-settings test-pairing-dialog
+noinst_PROGRAMS = test-client test-agent test-deviceselection test-class test-settings test-pairing-dialog 
test-pin
 
 test_client_LDADD = libgnome-bluetooth.la $(LIBGNOMEBT_LIBS)
 
@@ -129,6 +129,9 @@ test_settings_LDADD = libgnome-bluetooth.la $(LIBGNOMEBT_LIBS)
 
 test_pairing_dialog_LDADD = libgnome-bluetooth.la $(LIBGNOMEBT_LIBS)
 
+test_pin_SOURCES = test-pin.c
+test_pin_LDADD = libgnome-bluetooth.la $(LIBGNOMEBT_LIBS)
+
 pin_DATA = pin-code-database.xml
 pindir = $(pkgdatadir)
 
diff --git a/lib/test-pin.c b/lib/test-pin.c
new file mode 100644
index 0000000..5fea660
--- /dev/null
+++ b/lib/test-pin.c
@@ -0,0 +1,20 @@
+#include "pin.c"
+#include "bluetooth-enums.h"
+
+int main (int argc, char **argv)
+{
+       guint max_digits;
+       gboolean confirm;
+       char *pin;
+
+       pin = get_pincode_for_device (BLUETOOTH_TYPE_KEYBOARD,
+                                     "00:13:6C:00:00:00",
+                                     "TomTom Remote",
+                                     &max_digits,
+                                     &confirm);
+
+       g_message ("pin: %s max digits: %d confirm: %d",
+                  pin, max_digits, confirm);
+
+       return 0;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]