Beispiel #1
0
void main(void)
{
	int     rv;       /* return value from tests */

	TC_START("Test Nanokernel LIFO");

	initNanoObjects();

	/*
	 * Start the fiber.  The fiber will be given a higher priority than the
	 * main task.
	 */

	task_fiber_start(fiberStack, FIBER_STACKSIZE, fiberEntry,
		0, 0, FIBER_PRIORITY, 0);

	rv = taskLifoWaitTest();

	if (rv == TC_PASS) {
		rv = taskLifoNonWaitTest();
	}

	if (rv == TC_PASS) {
		rv = test_multiple_waiters();
	}

	/* test timeouts */
	if (rv == TC_PASS) {
		rv = test_timeout();
	}

	TC_END_RESULT(rv);
	TC_END_REPORT(rv);
}
Beispiel #2
0
void main(void)
{
	int     rv;       /* return value from tests */

	TC_START("Test Nanokernel Semaphores");

	initNanoObjects();

	rv = testSemTaskNoWait();
	if (rv != TC_PASS) {
		goto doneTests;
	}

	rv = testSemIsrNoWait();
	if (rv != TC_PASS) {
		goto doneTests;
	}

	semTestState = STS_INIT;

	/*
	 * Start the fiber.  The fiber will be given a higher priority than the
	 * main task.
	 */

	task_fiber_start(fiberStack, FIBER_STACKSIZE, fiberEntry,
					 0, 0, FIBER_PRIORITY, 0);

	rv = testSemWait();
	if (rv != TC_PASS) {
		goto doneTests;
	}

	rv = test_multiple_waiters();
	if (rv != TC_PASS) {
		goto doneTests;
	}

	rv = test_timeout();
	if (rv != TC_PASS) {
		goto doneTests;
	}

doneTests:
	TC_END_RESULT(rv);
	TC_END_REPORT(rv);
}