Delimiter //
/**
 * Test of LOADER_GUARANTEED_NORMALIZE_NAME_NOT_NULL()
 * @test
 */
DROP Procedure IF EXISTS TEST_LOADER_GUARANTEED_NORMALIZE_NAME_NOT_NULL//
Create Procedure TEST_LOADER_GUARANTEED_NORMALIZE_NAME_NOT_NULL()
Begin

    -- initial dataset
    CALL LOADER_GUARANTEED_CLEAN();

    CALL LOADER_GUARANTEED_PUSH(1, 'GUARANTEED_NAME = ''4242.42'' ', 1, NULL);
    CALL LOADER_GUARANTEED_PUSH(2, 'GUARANTEED_NAME = null ', 2, NULL);

     -- Procedure
    CALL LOADER_GUARANTEED_NORMALIZE_NAME_NOT_NULL(1);

    -- Assertions
    CALL utAssert_eq('Data without NAME are flagged' 
        , 1
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 2) 
    );
    CALL utAssert_eq('Data with NAME are not flagged' 
        , 0
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 1) 
    );

    -- clean
    CALL LOADER_GUARANTEED_CLEAN();

End //
Delimiter ;
