mirror of
https://github.com/lammertb/libhttp.git
synced 2025-12-22 04:02:04 +03:00
First unit test for main.c
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
<ClCompile Include="..\..\test\private.c">
|
<ClCompile Include="..\..\test\private.c">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\test\private_exe.c" />
|
||||||
<ClCompile Include="..\..\test\public_func.c" />
|
<ClCompile Include="..\..\test\public_func.c" />
|
||||||
<ClCompile Include="..\..\test\public_server.c" />
|
<ClCompile Include="..\..\test\public_server.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -44,5 +44,8 @@
|
|||||||
<ClCompile Include="..\..\src\civetweb.c">
|
<ClCompile Include="..\..\src\civetweb.c">
|
||||||
<Filter>Quelldateien</Filter>
|
<Filter>Quelldateien</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\test\private_exe.c">
|
||||||
|
<Filter>Quelldateien</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -26,7 +26,10 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
#define printf DO_NOT_USE_PRINTF
|
|
||||||
|
#define main \
|
||||||
|
exe_main /* main is already used in the test suite, \
|
||||||
|
* rename main in main.c */
|
||||||
#include "../src/main.c"
|
#include "../src/main.c"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -40,15 +43,15 @@
|
|||||||
|
|
||||||
START_TEST(test_helper_funcs)
|
START_TEST(test_helper_funcs)
|
||||||
{
|
{
|
||||||
const char *psrc = "test str";
|
const char *psrc = "test str";
|
||||||
char *pdst;
|
char *pdst;
|
||||||
|
|
||||||
/* test sdup */
|
/* test sdup */
|
||||||
pdst = sdup(psrc);
|
pdst = sdup(psrc);
|
||||||
ck_assert(pdst != NULL);
|
ck_assert(pdst != NULL);
|
||||||
ck_assert_str_eq(pdst, psrc);
|
ck_assert_str_eq(pdst, psrc);
|
||||||
ck_assert_ptr_ne(pdst, psrc);
|
ck_assert_ptr_ne(pdst, psrc);
|
||||||
free(pdst);
|
free(pdst);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ Suite *make_private_exe_suite(void)
|
|||||||
|
|
||||||
tcase_add_test(helper_funcs, test_helper_funcs);
|
tcase_add_test(helper_funcs, test_helper_funcs);
|
||||||
tcase_set_timeout(helper_funcs, civetweb_min_test_timeout);
|
tcase_set_timeout(helper_funcs, civetweb_min_test_timeout);
|
||||||
suite_add_tcase(suite, encode_decode);
|
suite_add_tcase(suite, helper_funcs);
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user