mirror of
https://github.com/troglobit/libite.git
synced 2026-10-06 23:40:05 +07:00
Add simple ocular unit test for printheader()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user