bulk memory: memory.{fill, copy, init} and data.drop (#504)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io> Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -26,6 +26,24 @@ func TestRuntimeConfig(t *testing.T) {
|
||||
memoryMaxPages: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "bulk-memory-operations",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
return c.WithFeatureBulkMemoryOperations(true)
|
||||
},
|
||||
expected: &RuntimeConfig{
|
||||
enabledFeatures: wasm.FeatureBulkMemoryOperations,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "multi-value",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
return c.WithFeatureMultiValue(true)
|
||||
},
|
||||
expected: &RuntimeConfig{
|
||||
enabledFeatures: wasm.FeatureMultiValue,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "mutable-global",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
@@ -35,15 +53,6 @@ func TestRuntimeConfig(t *testing.T) {
|
||||
enabledFeatures: wasm.FeatureMutableGlobal,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sign-extension-ops",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
return c.WithFeatureSignExtensionOps(true)
|
||||
},
|
||||
expected: &RuntimeConfig{
|
||||
enabledFeatures: wasm.FeatureSignExtensionOps,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "nontrapping-float-to-int-conversion",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
@@ -53,6 +62,15 @@ func TestRuntimeConfig(t *testing.T) {
|
||||
enabledFeatures: wasm.FeatureNonTrappingFloatToIntConversion,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sign-extension-ops",
|
||||
with: func(c *RuntimeConfig) *RuntimeConfig {
|
||||
return c.WithFeatureSignExtensionOps(true)
|
||||
},
|
||||
expected: &RuntimeConfig{
|
||||
enabledFeatures: wasm.FeatureSignExtensionOps,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tc := tt
|
||||
@@ -74,6 +92,22 @@ func TestRuntimeConfig_FeatureToggle(t *testing.T) {
|
||||
expectDefault bool
|
||||
setFeature func(*RuntimeConfig, bool) *RuntimeConfig
|
||||
}{
|
||||
{
|
||||
name: "bulk-memory-operations",
|
||||
feature: wasm.FeatureBulkMemoryOperations,
|
||||
expectDefault: false,
|
||||
setFeature: func(c *RuntimeConfig, v bool) *RuntimeConfig {
|
||||
return c.WithFeatureBulkMemoryOperations(v)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "multi-value",
|
||||
feature: wasm.FeatureMultiValue,
|
||||
expectDefault: false,
|
||||
setFeature: func(c *RuntimeConfig, v bool) *RuntimeConfig {
|
||||
return c.WithFeatureMultiValue(v)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "mutable-global",
|
||||
feature: wasm.FeatureMutableGlobal,
|
||||
@@ -82,14 +116,6 @@ func TestRuntimeConfig_FeatureToggle(t *testing.T) {
|
||||
return c.WithFeatureMutableGlobal(v)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sign-extension-ops",
|
||||
feature: wasm.FeatureSignExtensionOps,
|
||||
expectDefault: false,
|
||||
setFeature: func(c *RuntimeConfig, v bool) *RuntimeConfig {
|
||||
return c.WithFeatureSignExtensionOps(v)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "nontrapping-float-to-int-conversion",
|
||||
feature: wasm.FeatureNonTrappingFloatToIntConversion,
|
||||
@@ -98,6 +124,14 @@ func TestRuntimeConfig_FeatureToggle(t *testing.T) {
|
||||
return c.WithFeatureNonTrappingFloatToIntConversion(v)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sign-extension-ops",
|
||||
feature: wasm.FeatureSignExtensionOps,
|
||||
expectDefault: false,
|
||||
setFeature: func(c *RuntimeConfig, v bool) *RuntimeConfig {
|
||||
return c.WithFeatureSignExtensionOps(v)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user