Test Impact Inventory Input Validator (mcp/test_impact_inventory_input.c)

codebase-memory-mcp · src/mcp/test_impact_inventory_input.c · c · MIT
dev-tools, pos, testing, lang:c, tag:validation

Validates OID strings and binds inventory view for test impact analysis, ensuring correct format and supported revisions before processing inventory data.

// Source: https://github.com/DeusData/codebase-memory-mcp | License: MIT | Copyright 2025 DeusData
// Provided via justclaw.it.com; keep this notice with the code.
#include "mcp/test_impact_inventory_internal.h"
#include <string.h>

static bool cni_oid(cni_context *c, const char *oid, size_t width) {
    if (!cni_bytes(c, width + 1)) {
        return false;
    }
    for (size_t i = 0; i < width; i++) {
        unsigned char ch = (unsigned char)oid[i];
        if (!((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f'))) {
            return cni_fail(c, CBM_INVENTORY_INVALID);
        }
    }
    return !oid[width] || cni_fail(c, CBM_INVENTORY_INVALID);
}

bool cni_binding(cni_context *c, const cbm_pinned_tree_view_t *view) {
    if (!view) {
        return cni_fail(c, CBM_INVENTORY_STATE)

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key