Skip to content

Commit

Permalink
Notihng
Browse files Browse the repository at this point in the history
  • Loading branch information
buttonfly1000 committed Dec 4, 2016
1 parent 6c4d53b commit e6c362c
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
56 changes: 56 additions & 0 deletions test/mcontext/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include "../../common.h"
#include "../../mcontext.h"
#include <stdlib.h>
#include <time.h>

typedef struct {
IHeader h;
uint16_t i;
} HH;

IHeader *MakeOne(void)
{
static int s = 0;

static HH h;

h.h.HashValue = s++;

h.i = s++;

return (IHeader *)&h;
}

int main(void)
{
HH a, b;

ModuleContext c;

ModuleContext_Init(&c);

a = *(HH *)MakeOne();

c.Add(&c, (IHeader *)&a);
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());
c.Add(&c, MakeOne());

c.FindAndRemove(&c, (IHeader *)&a, (IHeader *)&b);

return 0;
}
68 changes: 68 additions & 0 deletions test/mcontext/mcontext.cbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="mcontext" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/mcontext" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/mcontext" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="../../array.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../array.h" />
<Unit filename="../../bst.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../bst.h" />
<Unit filename="../../common.h" />
<Unit filename="../../dnsparser.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../dnsparser.h" />
<Unit filename="../../iheader.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../iheader.h" />
<Unit filename="../../mcontext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../mcontext.h" />
<Unit filename="../../utils.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../utils.h" />
<Unit filename="main.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<envvars />
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

0 comments on commit e6c362c

Please sign in to comment.