aboutsummaryrefslogtreecommitdiff
path: root/src/tests/ktests/cmdline/test.c
blob: 677437654713e381c5e67014949cf1a578da1ef9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void test_cmdline(multiboot_info_t *mbd, fs_t *iofs) {
	BEGIN_TEST("test-cmdline");

	fs_handle_t *f = fs_open(iofs, "/cmdline", FM_READ);
	ASSERT(f != 0);

	char buf[256];
	size_t l = file_read(f, 0, 255, buf);
	ASSERT(l > 0);
	buf[l] = 0;

	unref_file(f);
	dbg_printf("Command line as in /cmdline file: '%s'.\n", buf);

	ASSERT(strcmp(buf, (char*)mbd->cmdline) == 0);

	TEST_OK;
}

#undef TEST_PLACEHOLDER_AFTER_DEVFS
#define TEST_PLACEHOLDER_AFTER_DEVFS { test_cmdline(mbd, iofs); }

/* vim: set ts=4 sw=4 tw=0 noet :*/