Changeset 41171 for trunk/psLib/test/sys/tap_psLine.c
- Timestamp:
- Nov 27, 2019, 11:57:38 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tap_psLine.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psLine.c
r12781 r41171 23 23 psLogSetLevel(PS_LOG_INFO); 24 24 25 // testLineAlloc()25 // testLineAlloc() 26 26 { 27 27 psMemId id = psMemGetId(); 28 28 psLine *lineline = NULL; 29 29 lineline = psLineAlloc(20); 30 ok(lineline->NLINE ==20, "psLine set NLINE parameter during Allocation");31 ok(lineline->Nline == 0, "psLine set Nline parameter during Allocation");30 ok(lineline->NLINE == 20, "psLine set NLINE parameter during Allocation"); 31 ok(lineline->Nline == 0, "psLine set Nline parameter during Allocation"); 32 32 strncpy(lineline->line, "Hello World", 20); 33 ok(!strncmp(lineline->line, "Hello World", 20), 34 "psLine was stored a simple string!"); 33 ok(!strncmp(lineline->line, "Hello World", 20), "psLine was stored a simple string!"); 35 34 psFree(lineline); 36 35 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 41 40 psMemId id = psMemGetId(); 42 41 psLine *line = NULL; 43 // Return false for NULL input42 // Return false for NULL input 44 43 int okay = !psLineInit(line); 45 44 ok(okay, "psLineInit. Expected false for NULL psLine input"); 46 // Allocate a line and return true on Init45 // Allocate a line and return true on Init 47 46 line = psLineAlloc(1); 48 47 okay = psLineInit(line); … … 65 64 int okay = psLineAdd(line, "Hello %s", "World"); 66 65 ok( okay, "psLineAdd. Expected true for valid psLine input"); 67 ok(line->NLINE == 20 && line->Nline == 11, 68 "psLineAdd failed to return the correct line parameters"); 69 ok(!strncmp(line->line, "Hello World", 20), 70 "psLineAdd failed to store the correct line string."); 66 ok(line->NLINE == 20 && line->Nline == 11, "psLineAdd failed to return the correct line parameters"); 67 ok(!strncmp(line->line, "Hello World", 20), "psLineAdd failed to store the correct line string."); 71 68 psFree(line); 72 69 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 79 76 psLine *line = NULL; 80 77 //Return false for Null input line 81 ok(!psMemCheckLine(line), 82 "psMemCheckLine return false for NULL line input"); 78 ok(!psMemCheckLine(line), "psMemCheckLine return false for NULL line input"); 83 79 line = psLineAlloc(1); 84 ok(psMemCheckLine(line), 85 "psMemCheckLine return true for valid line input"); 80 ok(psMemCheckLine(line), "psMemCheckLine return true for valid line input"); 86 81 psFree(line); 87 82 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
Note:
See TracChangeset
for help on using the changeset viewer.
