MCPcopy Create free account
hub / github.com/WheretIB/nullc / TEST_FOR_FAIL_FULL

Function TEST_FOR_FAIL_FULL

tests/TestCompileFail.cpp:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "TestBase.h"
4
5void TEST_FOR_FAIL_FULL(const char* name, const char* str, const char* error)
6{
7 testsCount[TEST_FAILURE_INDEX]++;
8 nullres good = nullcCompile(str);
9 if(!good)
10 {
11 char buf[4096];
12 strncpy(buf, nullcGetLastError(), 4095); buf[4095] = 0;
13 if(strcmp(error, buf) != 0)
14 {
15 printf("Failed %s but for wrong reason:\r\n %s\r\nexpected:\r\n %s\r\n", name, buf, error);
16 }else{
17 testsPassed[TEST_FAILURE_INDEX]++;
18 }
19 }else{
20 printf("Test \"%s\" failed to fail.\r\n", name);
21 }
22}
23
24
25void RunCompileFailTests()

Callers 1

Calls 3

nullcCompileFunction · 0.85
nullcGetLastErrorFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected