MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / everything

Function everything

tests/all/component_model/dynamic.rs:743–861  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

741
742#[test]
743fn everything() -> Result<()> {
744 // This serves to test both nested types and storing parameters on the heap (i.e. exceeding `MAX_STACK_PARAMS`)
745
746 let engine = super::engine();
747 let mut store = Store::new(&engine, ());
748
749 let component = Component::new(
750 &engine,
751 make_echo_component_with_params(
752 r#"
753 (type $b' (enum "a" "b"))
754 (export $b "b" (type $b'))
755 (type $c' (record (field "D" bool) (field "E" u32)))
756 (export $c "c" (type $c'))
757 (type $f' (flags "G" "H" "I"))
758 (export $f "f" (type $f'))
759 (type $m' (record (field "N" bool) (field "O" u32)))
760 (export $m "m" (type $m'))
761 (type $j' (variant
762 (case "K" u32)
763 (case "L" float64)
764 (case "M" $m)
765 ))
766 (export $j "j" (type $j'))
767
768 (type $Foo' (record
769 (field "A" u32)
770 (field "B" $b)
771 (field "C" $c)
772 (field "F" (list $f))
773 (field "J" $j)
774 (field "P" s8)
775 (field "Q" s16)
776 (field "R" s32)
777 (field "S" s64)
778 (field "T" float32)
779 (field "U" float64)
780 (field "V" string)
781 (field "W" char)
782 (field "Y" (tuple u32 u32))
783 (field "AA" (option u32))
784 (field "BB" (result string (error string)))
785 ))
786 "#,
787 &[
788 Param(Type::I32, Some(0)),
789 Param(Type::U8, Some(4)),
790 Param(Type::U8, Some(5)),
791 Param(Type::I32, Some(8)),
792 Param(Type::I32, Some(12)),
793 Param(Type::I32, Some(16)),
794 Param(Type::U8, Some(20)),
795 Param(Type::I64, Some(28)),
796 Param(Type::I32, Some(32)),
797 Param(Type::S8, Some(36)),
798 Param(Type::S16, Some(38)),
799 Param(Type::I32, Some(40)),
800 Param(Type::I64, Some(48)),

Callers

nothing calls this directly

Calls 11

ParamClass · 0.85
OkFunction · 0.85
engineFunction · 0.50
newFunction · 0.50
RecordClass · 0.50
instantiateMethod · 0.45
unwrapMethod · 0.45
get_funcMethod · 0.45
callMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected