|
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. | NEI PREFERITI | .:: | RSS Forum | RSS News | NEWS web | NEWS software | |
| PUBBLICITA' | | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | | CERCA nel FORUM » | |
29-03-2006, 20.06.28 | #16 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Codice:
Program received signal SIGSEGV, Segmentation fault. 0x4008677e in fread () from /lib/tls/libc.so.6 |
29-03-2006, 20.11.10 | #17 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
No non ci credo. Aggiungendo quelle linee mi finisce tutti i test. Però sinceramente non capisco perché gli ultimi due test mi dice che non li ho passati. Come mai?
|
29-03-2006, 20.19.10 | #18 |
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
hai anche dimenticato una malloc:
in LPC_DeleteDBF.c, LINE 21: tmp = (char *)malloc(sizeof(char) * (strlen(Name) + 1)); va inserita prima della strcpy(tmp,Name);
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
29-03-2006, 20.25.11 | #19 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Grazie. Senti mi sapresti dire perché nei test mi ritorna un valore invece che un altro? Ad esempio nel test che controlla se un campo è valido mi ritorna DBF esistente, mentre io gli ho detto di tornare esplicitamente Nome campo o tipo non valido qualcosa del genere.
|
29-03-2006, 20.31.15 | #20 |
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
Dove?
Questo è l'output sulla mia macchina: Codice:
Test CREATE Test:[10101] Peso:[3] - [CREATE: nome NULL] Errore [-1] in [CreateDatabaseFile]-->[Nome DB nullo o non valido o NumFields<=0] Ritorno della create: [-1] Test:[10102] Peso:[1] - [CREATE: nome non valido] Errore [-1] in [CreateDatabaseFile]-->[Nome DB nullo o non valido o NumFields<=0] Ritorno della create: [-1] Test:[10103] Peso:[1] - [CREATE [%d]: nome non valido (2)] Errore [-1] in [CreateDatabaseFile]-->[Nome DB nullo o non valido o NumFields<=0] Ritorno della create: [-1] Test:[10104] Peso:[3] - [CREATE: NumFields nonvalido] Errore [-1] in [CreateDatabaseFile]-->[Nome DB nullo o non valido o NumFields<=0] Ritorno della create: [-1] Test:[10105] Peso:[3] - [CREATE: NumFields nonvalido (2)] Errore [-1] in [CreateDatabaseFile]-->[Nome DB nullo o non valido o NumFields<=0] Ritorno della create: [-1] Test:[10106] Peso:[3] - [CREATE: FieldData nonvalido] Errore [-8] in [CreateDatabaseFile]-->[Errore allocazione memoria] Ritorno della create: [-8] Test:[10107] Peso:[1] - [CREATE: Nome campo non valido] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10108] Peso:[3] - [CREATE: Tipo campo non valido] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10109] Peso:[2] - [CREATE: Lunghezza campo non valida] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10110] Peso:[2] - [CREATE: Campo gia' esistente] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10111] Peso:[4] - [CREATE: DBF esistente] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10112] Peso:[10] - [CREATE: Funzionalita'] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] Test:[10113] Peso:[10] - [CREATE: Verifica correttezza] ID: 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 PESO: 3 1 1 3 3 3 1 3 2 2 4 10 10 PASS: 1 1 1 1 1 1 1 1 1 1 1 0 0 Fine Test [CREATE]: Numtests:[13] Totvalue:[46] Passed:[26] Score:[56.52] Test DELETE Test:[10201] Peso:[2] - [DELETE: nome NULL] Errore [-1] in [DeleteDatabaseFile]-->[Nome DB nullo o non valido] Ritorno della delete: [-1] Test:[10202] Peso:[1] - [DELETE: nome non valido] Errore [-1] in [DeleteDatabaseFile]-->[Nome DB nullo o non valido] Ritorno della delete: [-1] Test:[10203] Peso:[1] - [DELETE: nome non valido (2)] Errore [-1] in [DeleteDatabaseFile]-->[Nome DB nullo o non valido] Ritorno della delete: [-1] Test:[10204] Peso:[2] - [Test DELETE: DBF non esistente] Errore [-4] in [DeleteDatabaseFile]-->[Il file non esiste o non può essere cancellato] Ritorno della delete: [-4] Test:[10205] Peso:[3] - [Test DELETE: DBF aperto ] Errore [-10] in [DeleteDatabaseFile]-->[Il database è aperto] Ritorno della delete: [-10] Test:[10206] Peso:[10] - [Test DELETE: Funzionalita'] Errore [-4] in [DeleteDatabaseFile]-->[Il file non esiste o non può essere cancellato] Ritorno della Delete: [-4] ID: 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10201 10202 10203 10204 10205 10206 PESO: 3 1 1 3 3 3 1 3 2 2 4 10 10 2 1 1 2 3 10 PASS: 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 Fine Test [DELETE]: Numtests:[19] Totvalue:[65] Passed:[35] Score:[53.85]
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
29-03-2006, 20.34.33 | #21 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Codice:
Test:[10111] Peso:[4] - [CREATE: DBF esistente] Errore [-2] in [CreateDatabaseFile]-->[Valore di uno dei campi non valido: nome, tipo o lunghezza] Ritorno della create: [-2] |
29-03-2006, 20.37.27 | #22 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Poi scusa un'altra cosa. Come faccio a scrivere tutta quella struttura che ho riempito tramite la fwrite? Come ho scritto io mi sa che non va bene.
|
29-03-2006, 21.17.27 | #23 |
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
no, non puoi scrivere una struttura su file... devi serializzarla in qualche modo in una stringa. Qual è il formato del file?
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
29-03-2006, 22.10.20 | #24 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Nelle specifiche c'è scritto di serializzare tutti i campi in un buffer e poi scriverli tutti d'un colpo sul file. Il formato del file non te lo so dire ma come puoi notare viene aperto in binario. Come posso fare allora?
|
29-03-2006, 22.14.10 | #25 |
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
qualcosa tipo
sprintf(buf, "%s|%d|%s|%s", h->stringval, h->intval, h->newstring, h->otherstring); però bisognerebbe sapere quale formato usare...
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
29-03-2006, 22.19.22 | #26 |
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
BTW:
file LPC_CreateDBF.c perché assegni due volte i valori ai campi della struttura (linee 49 e seguenti) Codice:
h->NumCampi = (uint16_t) htons(h->NumCampi); //inutile? h->NumCampi = NumFields; .... Codice:
strcpy(h->campo[i].name,FieldData[i].Name); if ( (FieldData[i].FieldType != CHARACTER) && (FieldData[i].FieldType != NUMERIC) && (FieldData[i].FieldType != DATE) && (FieldData[i].FieldType != LOGICAL) ) {
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
29-03-2006, 22.47.29 | #27 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Codice:
sprintf(buf, "%s|%d|%s|%s", h->stringval, h->intval, h->newstring, h->otherstring); Codice:
h->NumCampi = (uint16_t) htons(h->NumCampi); //inutile? h->NumCampi = NumFields; Codice:
if ( (FieldData[i].FieldType != CHARACTER) && (FieldData[i].FieldType != NUMERIC) && (FieldData[i].FieldType != DATE) && (FieldData[i].FieldType != LOGICAL) ) { |
29-03-2006, 22.52.27 | #28 | ||
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
Quota:
Quota:
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
||
29-03-2006, 22.56.57 | #29 |
Hero Member
Registrato: 15-10-2000
Messaggi: 588
|
Codice:
and? Prima serializzi la struttura in una stringa "buf", poi fai il dump del buffer su file con la fwrite()... Codice:
d'accordo, ma se alla riga successiva lo sovrascrivi con un altro valore (NumFields), a che serve? |
29-03-2006, 23.05.53 | #30 | ||
WT Assistant
Registrato: 19-12-2000
Loc.: Cambiano (Torino)
Messaggi: 591
|
Quota:
Quota:
___________________________________
There are 10 kinds of people in this world, those who can read binary and those who can't. Care to say "thank you"? |
||
Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti) | |
Strumenti discussione | |
|
|
Discussioni simili | ||||
Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
Parole in musica | gemma | Chiacchiere in libertà | 415 | 03-06-2007 05.24.48 |
GENERAL PROTECTION FAULT | Slith | Hardware e Overclock | 8 | 24-06-2005 20.51.57 |
Quiz: Versi di canzoni | tisifone | Chiacchiere in libertà | 55 | 02-07-2004 19.13.03 |
fault in ms-dos extender | marcofitaly | Windows 9x/Me/NT4/2000 | 1 | 27-05-2004 23.45.27 |