MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / TestErrorCopySemantics

Function TestErrorCopySemantics

test/error.cc:74–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void TestErrorCopySemantics(const Napi::CallbackInfo& info) {
75 Napi::Error newError = Napi::Error::New(info.Env(), "errorCopyCtor");
76 Napi::Error existingErr;
77
78#ifdef NAPI_CPP_EXCEPTIONS
79 std::string msg = "errorCopyCtor";
80 assert(strcmp(newError.what(), msg.c_str()) == 0);
81#endif
82
83 Napi::Error errCopyCtor = newError;
84 assert(errCopyCtor.Message() == "errorCopyCtor");
85
86 existingErr = newError;
87 assert(existingErr.Message() == "errorCopyCtor");
88}
89
90void TestErrorMoveSemantics(const Napi::CallbackInfo& info) {
91 std::string errorMsg = "errorMoveCtor";

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected