gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-49


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-495-g5da6bf5
Date: Fri, 26 Apr 2013 08:35:33 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  5da6bf5e65fd4a48afc9d21a357bed69e1be4ee4 (commit)
      from  b6694baa30803eb3cd75453693cd0f503e41a0b1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=5da6bf5e65fd4a48afc9d21a357bed69e1be4ee4


commit 5da6bf5e65fd4a48afc9d21a357bed69e1be4ee4
Author: Daniele Forsi <address@hidden>
Date:   Thu Apr 25 22:55:48 2013 +0200

    Return error for incomplete vCards
    
    Now an error is returned by gn_vcard2phonebook() if the input file doesn't
    contain END:VCARD.
    Added tests to the testsuite.

diff --git a/common/vcard.c b/common/vcard.c
index 91c1221..6cc2abb 100644
--- a/common/vcard.c
+++ b/common/vcard.c
@@ -352,13 +352,15 @@ GNOKII_API int gn_vcard2phonebook(FILE *f, 
gn_phonebook_entry *entry)
        }
        str_append_printf(&str, buf);
 
+       retval = -1;
        while (fgets(buf, 1024, f)) {
                str_append_printf(&str, buf);
-               if (BEGINS("END:VCARD"))
+               if (BEGINS("END:VCARD")) {
+                       retval = gn_vcardstr2phonebook(str.str, entry);
                        break;
+               }
        }
 
-       retval = gn_vcardstr2phonebook(str.str, entry);
        free(str.str);
 
        return retval;
diff --git a/testsuite/out.02.writephonebook b/testsuite/out.02.writephonebook
new file mode 100644
index 0000000..b38fda9
--- /dev/null
+++ b/testsuite/out.02.writephonebook
@@ -0,0 +1 @@
+Write failed (Data format is not valid.): memory type: ME, loc: 1, name: , 
number: 
diff --git a/testsuite/out.03.writephonebook b/testsuite/out.03.writephonebook
new file mode 100644
index 0000000..b38fda9
--- /dev/null
+++ b/testsuite/out.03.writephonebook
@@ -0,0 +1 @@
+Write failed (Data format is not valid.): memory type: ME, loc: 1, name: , 
number: 
diff --git a/testsuite/out.04.writephonebook b/testsuite/out.04.writephonebook
new file mode 100644
index 0000000..b38fda9
--- /dev/null
+++ b/testsuite/out.04.writephonebook
@@ -0,0 +1 @@
+Write failed (Data format is not valid.): memory type: ME, loc: 1, name: , 
number: 
diff --git a/testsuite/out.05.writephonebook b/testsuite/out.05.writephonebook
new file mode 100644
index 0000000..a1e00a6
--- /dev/null
+++ b/testsuite/out.05.writephonebook
@@ -0,0 +1,8 @@
+AT+CPBW=1,"",129,""
+Write Succeeded: memory type: ME, loc: 1, name: , number: 
+AT+CPBW=2,"",129,""
+Write Succeeded: memory type: ME, loc: 2, name: , number: 
+AT+CPBW=3,"",129,""
+Write Succeeded: memory type: ME, loc: 3, name: , number: 
+AT+CPBW=4,"",129,""
+Write Succeeded: memory type: ME, loc: 4, name: , number: 
diff --git a/testsuite/test.02.writephonebook b/testsuite/test.02.writephonebook
new file mode 100644
index 0000000..b3c2342
--- /dev/null
+++ b/testsuite/test.02.writephonebook
@@ -0,0 +1 @@
+echo -n | $GNOKII --writephonebook --overwrite --vcard
diff --git a/testsuite/test.03.writephonebook b/testsuite/test.03.writephonebook
new file mode 100644
index 0000000..4d880ed
--- /dev/null
+++ b/testsuite/test.03.writephonebook
@@ -0,0 +1 @@
+echo -n "foobar" | $GNOKII --writephonebook --overwrite --vcard
diff --git a/testsuite/test.04.writephonebook b/testsuite/test.04.writephonebook
new file mode 100644
index 0000000..09077f1
--- /dev/null
+++ b/testsuite/test.04.writephonebook
@@ -0,0 +1 @@
+echo -n "BEGIN:VCARD" | $GNOKII --writephonebook --overwrite --vcard
diff --git a/testsuite/test.05.writephonebook b/testsuite/test.05.writephonebook
new file mode 100644
index 0000000..5e59423
--- /dev/null
+++ b/testsuite/test.05.writephonebook
@@ -0,0 +1,2 @@
+VCARD="BEGIN:VCARD\r\nEND:VCARD\r\n\r\n"
+echo -en "$VCARD$VCARD$VCARD$VCARD" | $GNOKII --writephonebook --overwrite 
--vcard
diff --git a/testsuite/testit b/testsuite/testit
index bb329cf..1942d4c 100755
--- a/testsuite/testit
+++ b/testsuite/testit
@@ -29,7 +29,9 @@ for A in test.00.identify \
        test.13.emspicture test.15.emspicture2 test.18.emsanimation \
        test.16.imelody \
        test.40.getsms test.41.getsms test.42.getsms test.43.getsms \
-       test.01.writephonebook; do
+       test.01.writephonebook test.02.writephonebook \
+       test.03.writephonebook test.04.writephonebook \
+       test.05.writephonebook; do
     echo -n "Doing $A... "
     B=`echo $A | sed s/test/out/`
     ( cd $TESTDIR; source $A 2>&1 ) | grep -v ^GNOKII > my$B

-----------------------------------------------------------------------

Summary of changes:
 common/vcard.c                   |    6 ++++--
 testsuite/out.02.writephonebook  |    1 +
 testsuite/out.03.writephonebook  |    1 +
 testsuite/out.04.writephonebook  |    1 +
 testsuite/out.05.writephonebook  |    8 ++++++++
 testsuite/test.02.writephonebook |    1 +
 testsuite/test.03.writephonebook |    1 +
 testsuite/test.04.writephonebook |    1 +
 testsuite/test.05.writephonebook |    2 ++
 testsuite/testit                 |    4 +++-
 10 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 testsuite/out.02.writephonebook
 create mode 100644 testsuite/out.03.writephonebook
 create mode 100644 testsuite/out.04.writephonebook
 create mode 100644 testsuite/out.05.writephonebook
 create mode 100644 testsuite/test.02.writephonebook
 create mode 100644 testsuite/test.03.writephonebook
 create mode 100644 testsuite/test.04.writephonebook
 create mode 100644 testsuite/test.05.writephonebook


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]