Пример #1
0
int main(int argc, const char *argv[]) {
    enablePool(RPool);
    ComplexTest();


    // [ ] ,  [ [ [ ] ] ],  [ [ ] [] [ ] ]
    const RString *source = RS(" ++++++++++ [ >+++++++>++++++++++>+++>+<<<<- ] >++\n"
                                  " .>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.\n"
                                  " ------.--------.>+.>.");

    RVirtualFunction *function = c(RVirtualFunction)(nil);
    function->name = RSC("Hello");
    function->masterRDataObject = makeRDataAllocated(5);
    function->masterRDataObject->data[0] = r_addition;
    function->masterRDataObject->data[1] = 0x01;

    function->masterRDataObject->data[2] = r_addition;
    function->masterRDataObject->data[3] = 0x23;

    function->masterRDataObject->data[4] = r_end;

    // brainfuck hard(with [, ]) hello world on RVM
//    RVirtualFunction *function = $(RVC, m(createFunctionFromBrainFuckSourceCode, RVirtualCompiler)), source );

    p(RVirtualFunction)(function);

    executeRay(function);

    deleter(function, RVirtualFunction);
    deleter(RVM, RVirtualMachine);
    deleter(RVC, RVirtualCompiler);

    endRay();
}
Пример #2
0
void runAllTests() {
	srand(time(0));
	simpleTest0();
	simpleTest1();
	simpleTest2();
	simpleTest3();
	simpleTest4();
	simpleTest5();
	simpleTest6();

	test0();
	for (size_t i = 0; i < 100; ++i) {
		test1(100);
	}

	for (size_t i = 0; i < 100; ++i) {
		ComplexTest().test(100);
	}
	return;
}
Пример #3
0
int main(int argc, const char *argv[]) {
    enablePool(RPool);
    ComplexTest();

    endRay();
}