MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / Module_UnitTest

Method Module_UnitTest

modules/dasUnitTest/test_handles.cpp:528–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528Module_UnitTest::Module_UnitTest() : Module("UnitTest") {
529 ModuleLibrary lib(this);
530 lib.addBuiltInModule();
531 addBuiltinDependency(lib, Module::require("math"));
532 addEnumTest(lib);
533 // options
534 options["unit_test"] = Type::tFloat;
535 // constant
536 addConstant(*this, "UNIT_TEST_CONSTANT", 0x12345678);
537 // structure annotations
538 addAnnotation(new CheckRange());
539 // dummy type example
540 addAnnotation(new DummyTypeAnnotation("SomeDummyType", "SomeDummyType", sizeof(SomeDummyType), alignof(SomeDummyType)));
541 // register types
542 addAnnotation(new TestObjectNotNullPtrAnnotation(lib));
543 addAnnotation(new TestObjectNotLocalAnnotation(lib));
544 auto fooann = new TestObjectFooAnnotation(lib);
545 addAnnotation(fooann);
546 initRecAnnotation(fooann,lib);
547 addAnnotation(new TestObjectBarAnnotation(lib));
548 // smart object recursive type
549 auto tosa = new TestObjectSmartAnnotation(lib);
550 addAnnotation(tosa);
551 initRecAnnotation(tosa, lib);
552 // events
553 addAnnotation(new EventRegistrator());
554 // test
555 addAnnotation(new TestFunctionAnnotation());
556 // point3 array
557 addAlias(typeFactory<Point3>::make(lib));
558 addVectorAnnotation<Point3Array>(this,lib,new Point3ArrayAnnotation(lib));
559 addCtorAndUsing<Point3Array>(*this, lib, "Point3Array", "Point3Array");
560 addExtern<DAS_BIND_FUN(testPoint3Array)>(*this, lib, "testPoint3Array",
561 SideEffects::modifyExternal, "testPoint3Array");
562 addExtern<DAS_BIND_FUN(testCMRES),SimNode_ExtFuncCallAndCopyOrMove>(*this, lib, "testCMRES",
563 SideEffects::modifyExternal, "testCMRES");
564
565 // abi tests. We use it in JIT.
566 addExtern<DAS_BIND_FUN(test_abi_mad2) >(*this,lib,"test_abi_mad",SideEffects::worstDefault,"test_abi_mad2")
567 ->args({"a","b","c"});
568 addExtern<DAS_BIND_FUN(test_abi_mad3) >(*this,lib,"test_abi_mad",SideEffects::worstDefault,"test_abi_mad3")
569 ->args({"a","b","c"});
570 addExtern<DAS_BIND_FUN(test_abi_mad4) >(*this,lib,"test_abi_mad",SideEffects::worstDefault,"test_abi_mad4")
571 ->args({"a","b","c"});
572 addExtern<DAS_BIND_FUN(test_abi_func) >(*this,lib,"test_abi_func",SideEffects::worstDefault,"test_abi_func")
573 ->args({"fn","context"});
574 // foo array
575 addExtern<DAS_BIND_FUN(testFooArray)>(*this, lib, "testFooArray",
576 SideEffects::modifyExternal, "testFooArray");
577 addExtern<DAS_BIND_FUN(set_foo_data)>(*this, lib, "set_foo_data",
578 das::SideEffects::modifyArgument, "set_foo_data");
579 // utf8 print
580 addExtern<DAS_BIND_FUN(builtin_printw)>(*this, lib, "printw",
581 SideEffects::modifyExternal, "builtin_printw");
582 // register function
583 addEquNeq<TestObjectFoo>(*this, lib);
584 addExtern<DAS_BIND_FUN(complex_bind)>(*this, lib, "complex_bind",
585 SideEffects::modifyExternal, "complex_bind");

Callers

nothing calls this directly

Calls 7

addConstantFunction · 0.85
initRecAnnotationFunction · 0.85
addBuiltInModuleMethod · 0.80
setTempResultMethod · 0.80
argsMethod · 0.45
argMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected