anchor.diff:                  end)
         end).
   
  +nif_encode_decode_mapfields() ->
  +    with_tmpdir(
  +      fun(TmpDir) ->
  +              M = gpb_nif_test_maps_with_mapfields_ed1,
  +              %% No need to test all types of keys/values, since that
  +              %% is already done in gpb_compile_tests.  Test only the
  +              %% map mechanism (as opposed to list of 2-tuples) here.
  +              Defs = ["message x {\n",
  +                      "   map<fixed32,string> i2s = 1;\n"
  +                      "}"],
  +              Opts = [maps],
  +              {ok, Code} = compile_nif_msg_defs(M, Defs, TmpDir, Opts),
  +              in_separate_vm(
  +                TmpDir, M, Code,
  +                fun() ->
  +                        Msg1 = #{i2s => #{11 => "aa",
  +                                          22 => "bb",
  +                                          33 => "cc"}},
  +                        Bin1 = M:encode_msg(Msg1, x),
  +                        Msg1 = M:decode_msg(Bin1, x),
  +
  +                        Msg2 = #{i2s => #{}},
  +                        Bin2 = M:encode_msg(Msg2, x),
  +                        Msg2 = M:decode_msg(Bin2, x),
  +
  +                        ok
  +                end)
  +      end).
  +
   -endif. %% NO_HAVE_MAPS
  
positive.code: -import(gpb_compile_tests, [unload_code/1]).
  
  -import(gpb_compile_tests, [nif_tests_check_prerequisites/1]).
  -import(gpb_compile_tests, [with_tmpdir/1]).
  -import(gpb_compile_tests, [in_separate_vm/4]).
  -import(gpb_compile_tests, [compile_nif_msg_defs/3, compile_nif_msg_defs/4]).
  
negative.code: %% verify ------------------------------------------------
  
  nif_test_() ->
      increase_timeouts(
        nif_tests_check_prerequisites(
          [{"Nif encode decode with unset optionals present_undefined",
            fun nif_encode_decode_present_undefined/0},
           {"Nif encode decode with unset optionals omitted",
            fun nif_encode_decode_omitted/0},
           increase_timeouts(
             nif_mapfield_tests_check_prerequisites(
               [{"Encode decode", fun nif_encode_decode_mapfields/0}]))])).
  
  nif_encode_decode_present_undefined() ->
      ProtocCanOneof = check_protoc_can_do_oneof(),
  