mirror of
https://github.com/troglobit/libite.git
synced 2026-11-09 16:21:18 +00:00
Add simple ocular unit test for printheader()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
2a59289d53
commit
441d5f58d7
2 files changed
+11
-3
No files matched your search
@@ -6,6 +6,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "../conio.h"
|
||||||
#include "../lite.h"
|
#include "../lite.h"
|
||||||
|
|
||||||
#define PRINT(args...) if (verbose) printf(args)
|
#define PRINT(args...) if (verbose) printf(args)
|
||||||
|
|||||||
+10
-3
@@ -6,7 +6,7 @@
|
|||||||
static int fstab(void)
|
static int fstab(void)
|
||||||
{
|
{
|
||||||
int field = 1;
|
int field = 1;
|
||||||
char *token, *dev;
|
char *token;
|
||||||
lfile_t *lf;
|
lfile_t *lf;
|
||||||
|
|
||||||
lf = lfopen(FSTAB, " \t\n");
|
lf = lfopen(FSTAB, " \t\n");
|
||||||
@@ -15,12 +15,19 @@ static int fstab(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printheader(NULL, "FILE SYSTEM MOUNT OPTIONS D P", 0);
|
||||||
while ((token = lftok(lf))) {
|
while ((token = lftok(lf))) {
|
||||||
if (field == 1)
|
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) {
|
if (field == 6) {
|
||||||
field = 0;
|
field = 0;
|
||||||
printf("Found %s passno %d\n", dev, atoi(token));
|
printf("%d\n", atoi(token));
|
||||||
}
|
}
|
||||||
|
|
||||||
field++;
|
field++;
|
||||||
|
|||||||
Reference in new issue
Block a user