--- /dev/null
+/*
+ * test_postres.c
+ *
+ * Copyright (c) 2010 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <btron/btron.h>
+#include <bstdio.h>
+#include <bstring.h>
+#include <bstdlib.h>
+#include <tcode.h>
+#include <btron/dp.h>
+#include <tad.h>
+
+#include "test.h"
+
+#include "postres.h"
+
+#include "sjisstring.h"
+
+LOCAL W test_postres_util_gen_file(LINK *lnk)
+{
+ LINK lnk0;
+ W fd, err;
+ TC name[] = {TK_t, TNULL};
+
+ err = get_lnk(NULL, &lnk0, F_NORM);
+ if (err < 0) {
+ return err;
+ }
+ err = cre_fil(&lnk0, name, NULL, 0, F_FLOAT);
+ if (err < 0) {
+ return err;
+ }
+ fd = err;
+
+ *lnk = lnk0;
+
+ return fd;
+}
+
+LOCAL UB test_genrequestbody_testdata01[] = { /* same with test_tadimf_testdata01 */
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0x46, 0x23, 0x52, 0x23, 0x4f, 0x23, 0x4d, 0x23,
+ 0x27, 0x21, 0x21, 0x21, 0x6e, 0x23, 0x61, 0x23,
+ 0x6d, 0x23, 0x65, 0x23, 0x0a, 0x00, 0x6d, 0x23,
+ 0x61, 0x23, 0x69, 0x23, 0x6c, 0x23, 0x27, 0x21,
+ 0x21, 0x21, 0x6d, 0x23, 0x61, 0x23, 0x69, 0x23,
+ 0x6c, 0x23, 0x0a, 0x00, 0x0a, 0x00, 0x62, 0x23,
+ 0x6f, 0x23, 0x64, 0x23, 0x79, 0x23, 0xe2, 0xff,
+ 0x00, 0x00,
+};
+LOCAL UB test_genrequestbody_testdata02[] = { /* same with test_tadimf_testdata02 */
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0x46, 0x23, 0x52, 0x23, 0x4f, 0x23, 0x4d, 0x23,
+ 0x27, 0x21, 0x21, 0x21, 0x0a, 0x00, 0x6d, 0x23,
+ 0x61, 0x23, 0x69, 0x23, 0x6c, 0x23, 0x27, 0x21,
+ 0x21, 0x21, 0x6d, 0x23, 0x61, 0x23, 0x69, 0x23,
+ 0x6c, 0x23, 0x0a, 0x00, 0x0a, 0x00, 0x62, 0x23,
+ 0x6f, 0x23, 0x64, 0x23, 0x79, 0x23, 0xe2, 0xff,
+ 0x00, 0x00,
+};
+LOCAL UB test_genrequestbody_testdata03[] = { /* same with test_tadimf_testdata03 */
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0x46, 0x23, 0x52, 0x23, 0x4f, 0x23, 0x4d, 0x23,
+ 0x27, 0x21, 0x21, 0x21, 0x6e, 0x23, 0x61, 0x23,
+ 0x6d, 0x23, 0x65, 0x23, 0x0a, 0x00, 0x6d, 0x23,
+ 0x61, 0x23, 0x69, 0x23, 0x6c, 0x23, 0x27, 0x21,
+ 0x21, 0x21, 0x0a, 0x00, 0x0a, 0x00, 0x62, 0x23,
+ 0x6f, 0x23, 0x64, 0x23, 0x79, 0x23, 0xe2, 0xff,
+ 0x00, 0x00,
+};
+LOCAL UB test_genrequestbody_testdata04[] = { /* same with test_tadimf_testdata09 */
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0x46, 0x23, 0x52, 0x23, 0x4f, 0x23, 0x4d, 0x23,
+ 0x27, 0x21, 0x0a, 0x00, 0x6d, 0x23, 0x61, 0x23,
+ 0x69, 0x23, 0x6c, 0x23, 0x27, 0x21, 0x0a, 0x00,
+ 0x0a, 0x00, 0x62, 0x23, 0x6f, 0x23, 0x64, 0x23,
+ 0x79, 0x23, 0xe2, 0xff, 0x00, 0x00,
+};
+
+LOCAL TEST_RESULT test_genrequestbody_1()
+{
+ LINK test_lnk;
+ W i, fd, err;
+ UB *testdata[] = {
+ test_genrequestbody_testdata01,
+ test_genrequestbody_testdata02,
+ test_genrequestbody_testdata03,
+ test_genrequestbody_testdata04,
+ };
+ W testdatasize[] = {
+ sizeof(test_genrequestbody_testdata01),
+ sizeof(test_genrequestbody_testdata02),
+ sizeof(test_genrequestbody_testdata03),
+ sizeof(test_genrequestbody_testdata04),
+ };
+ postresdata_t *postres;
+ UB board[] = "test";
+ UB thread[] = "000000000";
+ STIME time;
+ UB *body = NULL;
+ W body_len = 0;
+
+ for (i = 0; i < 4; i++) {
+ fd = test_postres_util_gen_file(&test_lnk);
+ if (fd < 0) {
+ return TEST_RESULT_FAIL;
+ }
+ err = ins_rec(fd, testdata[i], testdatasize[i], RT_TADDATA, 0, 0);
+ if (err < 0) {
+ cls_fil(fd);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ cls_fil(fd);
+
+ postres = postresdata_new();
+ if (postres == NULL) {
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ err = postresdata_readfile(postres, (VLINK *)&test_lnk);
+ if (err < 0) {
+ postresdata_delete(postres);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+
+ get_tim(&time, NULL);
+ err = postresdata_genrequestbody(postres, board, strlen(board), thread, strlen(thread), time, &body, &body_len);
+ if (err < 0) {
+ postresdata_delete(postres);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+
+ postresdata_delete(postres);
+
+ free(body);
+
+ del_fil(NULL, &test_lnk, 0);
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_genrequestbody_checkdata(UB *testdata, W testdata_len, UB *board, W board_len, UB *thread, W thread_len, STIME time, UB *expected, W expected_len)
+{
+ LINK test_lnk;
+ W fd, err;
+ postresdata_t *postres;
+ UB *body = NULL;
+ W body_len = 0;
+ TEST_RESULT result;
+
+ fd = test_postres_util_gen_file(&test_lnk);
+ if (fd < 0) {
+ return TEST_RESULT_FAIL;
+ }
+ err = ins_rec(fd, testdata, testdata_len, RT_TADDATA, 0, 0);
+ if (err < 0) {
+ cls_fil(fd);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ cls_fil(fd);
+
+ postres = postresdata_new();
+ if (postres == NULL) {
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ err = postresdata_readfile(postres, (VLINK *)&test_lnk);
+ if (err < 0) {
+ postresdata_delete(postres);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ err = postresdata_genrequestbody(postres, board, board_len, thread, thread_len, time, &body, &body_len);
+ if (err < 0) {
+ postresdata_delete(postres);
+ del_fil(NULL, &test_lnk, 0);
+ return TEST_RESULT_FAIL;
+ }
+ postresdata_delete(postres);
+
+ if (body_len != expected_len) {
+ printf("length different\n");
+ result = TEST_RESULT_FAIL;
+ } else {
+ if (strncmp(body, expected, expected_len) != 0) {
+ printf("string different\n");
+ result = TEST_RESULT_FAIL;
+ } else {
+ result = TEST_RESULT_PASS;
+ }
+ }
+ if (result != TEST_RESULT_PASS) {
+ printf("length: generated = %d, expected = %d\n", body_len, expected_len);
+ printf("string\n");
+ printf(" generated: ");
+ SJSTRING_DP(body, body_len);
+ printf("\n");
+ printf(" expected: ");
+ SJSTRING_DP(expected, expected_len);
+ printf("\n");
+ }
+
+ free(body);
+
+ del_fil(NULL, &test_lnk, 0);
+
+ return result;
+}
+
+LOCAL TEST_RESULT test_genrequestbody_2()
+{
+ UB *testdata = test_genrequestbody_testdata01;
+ W testdata_len = sizeof(test_genrequestbody_testdata01);
+ UB board[] = "test";
+ UB thread[] = "000000000";
+ STIME time = 1234567890;
+ UB expected[] = "bbs=test&key=000000000&time=1707953490&FROM=%82%8E%82%81%82%8D%82%85&mail=%82%8D%82%81%82%89%82%8C&MESSAGE=%82%82%82%8F%82%84%82%99&submit=%8F%91%82%AB%8D%9E%82%DE";
+
+ return test_genrequestbody_checkdata(testdata, testdata_len, board, strlen(board), thread, strlen(thread), time, expected, strlen(expected));
+}
+
+LOCAL TEST_RESULT test_genrequestbody_3()
+{
+ UB *testdata = test_genrequestbody_testdata02;
+ W testdata_len = sizeof(test_genrequestbody_testdata02);
+ UB board[] = "test";
+ UB thread[] = "000000000";
+ STIME time = 1234567890;
+ UB expected[] = "bbs=test&key=000000000&time=1707953490&FROM=&mail=%82%8D%82%81%82%89%82%8C&MESSAGE=%82%82%82%8F%82%84%82%99&submit=%8F%91%82%AB%8D%9E%82%DE";
+
+ return test_genrequestbody_checkdata(testdata, testdata_len, board, strlen(board), thread, strlen(thread), time, expected, strlen(expected));
+}
+
+LOCAL TEST_RESULT test_genrequestbody_4()
+{
+ UB *testdata = test_genrequestbody_testdata03;
+ W testdata_len = sizeof(test_genrequestbody_testdata03);
+ UB board[] = "test";
+ UB thread[] = "000000000";
+ STIME time = 1234567890;
+ UB expected[] = "bbs=test&key=000000000&time=1707953490&FROM=%82%8E%82%81%82%8D%82%85&mail=&MESSAGE=%82%82%82%8F%82%84%82%99&submit=%8F%91%82%AB%8D%9E%82%DE";
+
+ return test_genrequestbody_checkdata(testdata, testdata_len, board, strlen(board), thread, strlen(thread), time, expected, strlen(expected));
+}
+
+LOCAL TEST_RESULT test_genrequestbody_5()
+{
+ UB *testdata = test_genrequestbody_testdata04;
+ W testdata_len = sizeof(test_genrequestbody_testdata04);
+ UB board[] = "test";
+ UB thread[] = "000000000";
+ STIME time = 1234567890;
+ UB expected[] = "bbs=test&key=000000000&time=1707953490&FROM=&mail=&MESSAGE=%82%82%82%8F%82%84%82%99&submit=%8F%91%82%AB%8D%9E%82%DE";
+
+ return test_genrequestbody_checkdata(testdata, testdata_len, board, strlen(board), thread, strlen(thread), time, expected, strlen(expected));
+}
+
+LOCAL VOID test_postres_printresult(TEST_RESULT (*proc)(), B *test_name)
+{
+ TEST_RESULT result;
+
+ printf("test_postres: %s\n", test_name);
+ printf("---------------------------------------------\n");
+ result = proc();
+ if (result == TEST_RESULT_PASS) {
+ printf("--pass---------------------------------------\n");
+ } else {
+ printf("--fail---------------------------------------\n");
+ }
+ printf("---------------------------------------------\n");
+}
+
+EXPORT VOID test_postres_main()
+{
+ test_postres_printresult(test_genrequestbody_1, "test_genrequestbody_1");
+ test_postres_printresult(test_genrequestbody_2, "test_genrequestbody_2");
+ test_postres_printresult(test_genrequestbody_3, "test_genrequestbody_3");
+ test_postres_printresult(test_genrequestbody_4, "test_genrequestbody_4");
+ test_postres_printresult(test_genrequestbody_5, "test_genrequestbody_5");
+}