diff options
author | Alin Năstac <mrness@gentoo.org> | 2009-01-17 11:49:25 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2009-01-17 11:49:25 +0000 |
commit | f4035ec75c3c06fb91bc47741dfac0c26835b108 (patch) | |
tree | 80b924dbbabded31bcc8600a4d99b08286c7593f /app-mobilephone/gammu/files | |
parent | fix ChangeLog header (diff) | |
download | gentoo-2-f4035ec75c3c06fb91bc47741dfac0c26835b108.tar.gz gentoo-2-f4035ec75c3c06fb91bc47741dfac0c26835b108.tar.bz2 gentoo-2-f4035ec75c3c06fb91bc47741dfac0c26835b108.zip |
Version bump (#254391).
(Portage version: 2.1.4.5)
Diffstat (limited to 'app-mobilephone/gammu/files')
-rw-r--r-- | app-mobilephone/gammu/files/gammu-1.22.1-debug-test.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/app-mobilephone/gammu/files/gammu-1.22.1-debug-test.patch b/app-mobilephone/gammu/files/gammu-1.22.1-debug-test.patch new file mode 100644 index 000000000000..850823721f33 --- /dev/null +++ b/app-mobilephone/gammu/files/gammu-1.22.1-debug-test.patch @@ -0,0 +1,121 @@ +diff -Nru gammu-1.22.1.orig/tests/debug.c gammu-1.22.1/tests/debug.c +--- gammu-1.22.1.orig/tests/debug.c 2008-11-13 08:50:32.000000000 +0000 ++++ gammu-1.22.1/tests/debug.c 2009-01-17 11:43:26.000000000 +0000 +@@ -1,17 +1,24 @@ + #include <gammu.h> + #include <stdlib.h> + #include <stdio.h> +-#include <assert.h> + + GSM_StateMachine *s; + + #ifdef WIN32 + # define NUL "NUL" ++char debug_filename[] = ".\\gammu-debug-test.log"; + #else + # define NUL "/dev/null" ++char debug_filename[] = "./gammu-debug-test.log"; + #endif + +-char debug_filename[] = "gammu-debug-test-XXXXXX"; ++#define assert(val) \ ++{ \ ++ if (!(val)) {\ ++ fprintf(stderr, "Test \"%s\" failed!\n", ""#val); \ ++ exit(2); \ ++ } \ ++} + + NORETURN void fail(int errcode) + { +@@ -57,9 +64,6 @@ + int main(int argc UNUSED, char **argv UNUSED) + { + FILE *debug_file; +-#ifndef WIN32 +- int debug_fd; +-#endif + GSM_Debug_Info *di_sm, *di_global; + + /* Allocates state machine */ +@@ -69,16 +73,6 @@ + fail(1); + } + +-#ifndef WIN32 +- /* Create file for logs */ +- debug_fd = mkstemp(debug_filename); +- if (debug_fd == -1) { +- printf("Could not create temporary file!\n"); +- fail(2); +- } +- close(debug_fd); +-#endif +- + /* Get debug handles */ + di_sm = GSM_GetDebug(s); + di_global = GSM_GetGlobalDebug(); +@@ -95,6 +89,7 @@ + * Test 2 - global /dev/null, local tempfile, do not use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(false, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_global) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_sm) == ERR_NONE); +@@ -107,6 +102,7 @@ + * Test 3 - global /dev/null, local tempfile, use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(true, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_global) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_sm) == ERR_NONE); +@@ -119,6 +115,7 @@ + * Test 4 - global tempfile, local /dev/null, use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(true, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_sm) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_global) == ERR_NONE); +@@ -131,6 +128,7 @@ + * Test 5 - global tempfile, local /dev/null, do not use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(false, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_sm) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_global) == ERR_NONE); +@@ -142,6 +140,7 @@ + * Test 6 - global /dev/null, local tempfile, do not use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(true, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_global) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_sm) == ERR_NONE); +@@ -155,6 +154,7 @@ + * Test 7 - global /dev/null, local tempfile, use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(false, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_global) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_sm) == ERR_NONE); +@@ -168,6 +168,7 @@ + * Test 8 - global tempfile, local /dev/null, use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(false, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_sm) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_global) == ERR_NONE); +@@ -181,6 +182,7 @@ + * Test 9 - global tempfile, local /dev/null, do not use global + */ + debug_file = fopen(debug_filename, "w+"); ++ assert(debug_file != NULL); + assert(GSM_SetDebugGlobal(true, di_sm) == true); + assert(GSM_SetDebugFile(NUL, di_sm) == ERR_NONE); + assert(GSM_SetDebugFileDescriptor(debug_file, true, di_global) == ERR_NONE); |