<commit_before>#include <metodo/tests.h>

extern unsigned int start;
extern unsigned int end;

void SystemTests()
{
	MemorySizeTest();
	MMTest();
	KernelSizeTest();
	UsedFrameTest();
}

void KernelSizeTest()
{
	printf("Kernel size is approximately %i bytes (start: 0x%08x, end: 0x%08x)\n", &end-&start, &start, &end);
}

void MemorySizeTest()
{
	int bytes = mbd->mem_upper*1024;
	char *ext;
	int last;
	int exp = 0;
	while(1) {
		if ( bytes >= 1 ) {
			exp += 3;
			last = bytes;
			bytes /= 1024;
		} else {
			bytes = last;
			exp -= 3;
			break;
		}
	}

	switch(exp) {
	case 0:
		ext = " bytes";
		break;
	case 3:
		ext = "KB";
		break;
	case 6:
		ext = "MB";
		break;
	case 9:
		ext = "GB";
		break;
	}
	printf("We have %d%s of RAM\n", bytes, ext);
}

void MMTest()
{
	printf("Beginning memory management test:\n");
	printf("\tFirst free frame:  %i\n", first_frame());
	printf("\tAllocating frame at %i\n", first_frame());
	set_frame(first_frame(), 1, 1);
	printf("\tFirst free frame is now %i\n", first_frame());
	printf("Finished memory management test\n\n");
}

void UsedFrameTest()
{
	unsigned int i;
	for(i=0; i < end_memory; i += 0x1000) {
		if(test_frame(i)) {
			printf("Frame %u (%u-%u) is used.\n", i, i, i+0x0111);
		}
	}
}<commit_msg>Helps to use the right number of args, another warning gone!<commit_after>#include <metodo/tests.h>

extern unsigned int start;
extern unsigned int end;

void SystemTests()
{
	MemorySizeTest();
	MMTest();
	KernelSizeTest();
	UsedFrameTest();
}

void KernelSizeTest()
{
	printf("Kernel size is approximately %i bytes (start: 0x%08x, end: 0x%08x)\n", &end-&start, &start, &end);
}

void MemorySizeTest()
{
	int bytes = mbd->mem_upper*1024;
	char *ext;
	int last;
	int exp = 0;
	while(1) {
		if ( bytes >= 1 ) {
			exp += 3;
			last = bytes;
			bytes /= 1024;
		} else {
			bytes = last;
			exp -= 3;
			break;
		}
	}

	switch(exp) {
	case 0:
		ext = " bytes";
		break;
	case 3:
		ext = "KB";
		break;
	case 6:
		ext = "MB";
		break;
	case 9:
		ext = "GB";
		break;
	}
	printf("We have %d%s of RAM\n", bytes, ext);
}

void MMTest()
{
	printf("Beginning memory management test:\n");
	printf("\tFirst free frame:  %i\n", first_frame());
	printf("\tAllocating frame at %i\n", first_frame());
	set_frame(first_frame());
	printf("\tFirst free frame is now %i\n", first_frame());
	printf("Finished memory management test\n\n");
}

void UsedFrameTest()
{
	unsigned int i;
	for(i=0; i < end_memory; i += 0x1000) {
		if(test_frame(i)) {
			printf("Frame %u (%u-%u) is used.\n", i, i, i+0x0111);
		}
	}
}
{'fraction_non_alphanumeric': 0.1786698150334514, 'fraction_numerical': 0.027548209366391185, 'mean_word_length': 3.5311942959001783, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6402760', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1018, 'n_words': 280}