Add simple ocular unit test for printheader()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-06-30 20:28:31 +02:00
parent 2a59289d53
commit 441d5f58d7
2 changed files with 11 additions and 3 deletions
+1
View File
@@ -6,6 +6,7 @@
#include <string.h>
#include <time.h>
#include "../conio.h"
#include "../lite.h"
#define PRINT(args...) if (verbose) printf(args)
+10 -3
View File
@@ -6,7 +6,7 @@
static int fstab(void)
{
int field = 1;
char *token, *dev;
char *token;
lfile_t *lf;
lf = lfopen(FSTAB, " \t\n");
@@ -15,12 +15,19 @@ static int fstab(void)
return 1;
}
printheader(NULL, "FILE SYSTEM MOUNT OPTIONS D P", 0);
while ((token = lftok(lf))) {
if (field == 1)
dev = token;
printf("%-41s ", token);
if (field == 2)
printf("%-9s ", token);
if (field == 4)
printf("%-17s ", token);
if (field == 5)
printf("%d ", atoi(token));
if (field == 6) {
field = 0;
printf("Found %s passno %d\n", dev, atoi(token));
printf("%d\n", atoi(token));
}
field++;