MCPcopy Create free account
hub / github.com/Snapchat/Valdi / sanityCheck

Method sanityCheck

valdi_core/src/valdi_core/cpp/Schema/ValueSchema.cpp:893–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891ValueSchema ValueSchema::es6map(const ValueSchema& keySchema, const ValueSchema& valueSchema) {
892 return ValueSchema(ValueSchemaInnerTypeES6Map, 0, 0, makeShared<ES6MapSchema>(keySchema, valueSchema));
893}
894
895ValueSchema ValueSchema::es6set(const ValueSchema& keySchema) {
896 return ValueSchema(ValueSchemaInnerTypeES6Set, 0, 0, makeShared<ES6SetSchema>(keySchema));
897}
898
899ValueSchema ValueSchema::outcome(const ValueSchema& valueSchema, const ValueSchema& errorSchema) {
900 return ValueSchema(ValueSchemaInnerTypeOutcome, 0, 0, makeShared<OutcomeSchema>(valueSchema, errorSchema));
901}
902
903ValueSchema ValueSchema::proto(const std::string_view* classNamePartsBegin, const std::string_view* classNamePartsEnd) {
904 return ValueSchema(
905 ValueSchemaInnerTypeProto, 0, 0, makeShared<ProtoSchema>(classNamePartsBegin, classNamePartsEnd));
906}
907
908static void checkNotNull(const void* ptr) {
909 SC_ABORT_UNLESS(ptr != nullptr, "Nested type is null");
910}
911
912void ValueSchema::sanityCheck() const {
913 // Ticket: 1974
914 // Temporary check to try to figure out the root cause of what's happening
915 // in the JIRA above. It seems like the _ptr can become null while the type
916 // is set to something that expects a valid ptr.
917

Callers

nothing calls this directly

Calls 2

visitNestedTypeFunction · 0.85
checkNotNullFunction · 0.70

Tested by

no test coverage detected