Find Binary Tree Path Sum
We don't normally do this in real (non-toy) programs:

stTree *node = malloc(sizeof *node);
if (!node) abort();


It's convenient and probably okay for a simple exercise like this, though.

Code of the form if (c) then return true; else return false; simplifies to just return c;, so we can reduce
    if (sum == root-&gt;value)
        return true;
    else
        return false;

to just
    return sum == root-&gt;value;

I think we can do better than that, if we're happy to consider an empty tree as having a sum of zero:
bool hasPathSum(const stTree *node, int sum)
{
    if (!node) {
        return sum == 0;
    }

    sum -= node-&gt;value;
    return hasPathSum(node-&gt;left, sum) || hasPathSum(node-&gt;right, sum);
}

Notice that I've used || rather than | in my version - there's no need to continue looking once we've found a successful result.  Also, because this function is recursive, the name root is misleading for the parameter - it could be any node, and it's only the root in the top-level call.


void freeTree(stTree *node)
{
    if (!node) return true;


That's a simple error - can't return a value from a function declared void(...).  That suggests you're not enabling enough compiler warnings.

Good to see unit tests.  I'm not sure I'd pile all the test data together like that - I'd probably create a small function for each test, so that each test is independent.  Consider using one of the available test frameworks to help relieve the repetitive work of testing.
When writing tests, it's a good idea to write the smallest test you can think of (e.g. the null tree) as the first test, and start with it failing (so you know the test works).  Then make it pass, and write the next simplest failing tests (tree with one node - make sure you test calls that should return different values).
Here's how I would begin (using Google Test, which is C++, but it's easy to test C code by using extern &quot;C&quot;):
#include &lt;gtest/gtest.h&gt;

extern &quot;C&quot; {
    struct stTree;

    stTree* createNode(int value, stTree *leftNode, stTree *rightNode);
    bool hasPathSum(const stTree *node, int sum);
    void freeTree(stTree *node);
}

TEST(PathSum, empty)
{
    stTree *tree = NULL;
    EXPECT_FALSE(hasPathSum(tree, 1));
    EXPECT_TRUE(hasPathSum(tree, 0));
}

TEST(PathSum, one_node)
{
    stTree *tree = createNode(2, NULL, NULL);
    EXPECT_FALSE(hasPathSum(tree, 0));
    EXPECT_TRUE(hasPathSum(tree, 2));
}

TEST(PathSum, two_nodes)
{
    stTree *tree = createNode(2, NULL,
                              createNode(3, NULL, NULL));
    EXPECT_FALSE(hasPathSum(tree, 0));
    EXPECT_TRUE(hasPathSum(tree, 2));
    EXPECT_TRUE(hasPathSum(tree, 5));
}