message: test: WASI test for environ_get (check it's not implemented)
diff: @@ -493,3 +493,26 @@ TEST_F(wasi_mocked_test, environ_sizes_get)
  // environ_buf_size
  EXPECT_EQ(instance->memory->substr(4, 4), from_hex("00000000"));
  }
  +
  +TEST_F(wasi_mocked_test, environ_get)
  +{
  + /* wat2wasm
  + (func (import "wasi_snapshot_preview1" "environ_get") (param i32 i32) (result i32))
  + (memory (export "memory") 0)
  + (func (export "_start")
  + (call 0
  + (i32.const 0) ;; environ
  + (i32.const 0)) ;; environbuf
  + (if (i32.popcnt) (then unreachable)))
  + */
  + const auto wasm = from_hex(
  + "0061736d01000000010a0260027f7f017f60000002260116776173695f736e617073686f745f70726576696577"
  + "310b656e7669726f6e5f6765740000030201010503010000071302066d656d6f72790200065f73746172740001"
  + "0a0f010d00410041001000690440000b0b");
  +
  + auto instance = wasi::instantiate(*mock_uvwasi, wasm);
  +
  + std::ostringstream err;
  + EXPECT_FALSE(wasi::run(*mock_uvwasi, *instance, 0, nullptr, err));
  + EXPECT_EQ(err.str(), "Execution aborted with WebAssembly trap\n");
  +}
  