From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM, NUMERIC_HTTP_ADDR,URIBL_BLOCKED,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id E472080A34; Sun, 21 Aug 2022 11:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1661081167; bh=k8jRNgZzffYr/HBAuN5ouVXycpx6D7azGck0TshoafE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hd1U6rcKVizt6Qhm9E79bMONYth3rYlalbojrsQ550dAbSPMel0lnsYTLIQuODVO3 jV1u7y7y10T7UGLY5LlZyeYbhTcLhJ2kl9q1atLkUy3ozCIIlB2H+wmuCHVMRqLlJ9 n8otq40m3+kAtTha3kbTlE+CK15UT5mtxukbor2WBRfSkxLEmpkz+x1iO/OuEBe9Ri vxBjUi9BQA4V6h4delPlSalhXvwuTvXRf2rtrC5fx/JOZ0jJWQGf7Z6TOb06C6yFaT +v3vqGZLy9kOWBvSPRUuoYpiB9wGL68xuxUsBzT8BYU+u4p33rQRbAG2FP7uLBOsiJ TKgA66xSfpA7Q== From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ammar Faizi , Muhammad Rizki , Kanna Scarlet , GNU/Weeb Mailing List Subject: [PATCH v1 22/22] tests/cpp: Delete basic.cpp as it's no longer relevant Date: Sun, 21 Aug 2022 18:24:53 +0700 Message-Id: <20220821112453.3026255-23-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> References: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This test is no longer relevant as now we intend to always use CHNet class with ring support. Signed-off-by: Ammar Faizi --- tests/cpp/basic.cc | 97 ---------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 tests/cpp/basic.cc diff --git a/tests/cpp/basic.cc b/tests/cpp/basic.cc deleted file mode 100644 index 8ead825..0000000 --- a/tests/cpp/basic.cc +++ /dev/null @@ -1,97 +0,0 @@ - -#include -#include -#include -#include - -// #define NR_ASYNC_REQ 100 -// static void test_basic_async(void) -// { -// CHNet *ch[NR_ASYNC_REQ]; -// int i; - -// for (i = 0; i < NR_ASYNC_REQ; i++) { -// ch[i] = new CHNet; -// ch[i]->SetURL("http://127.0.0.1:8000/index.php?action=hello"); -// } - -// for (i = 0; i < NR_ASYNC_REQ; i++) -// ch[i]->Start(); - -// for (i = 0; i < NR_ASYNC_REQ; i++) -// ch[i]->WaitForResponseStarted(); - -// for (i = 0; i < NR_ASYNC_REQ; i++) -// ch[i]->Read(4096); - -// for (i = 0; i < NR_ASYNC_REQ; i++) -// ch[i]->WaitForReadCompleted(); - -// for (i = 0; i < NR_ASYNC_REQ; i++) { -// const char *buf; -// int ret; - -// ret = ch[i]->read_ret(); -// buf = ch[i]->buffer(); -// assert(ret == 13); -// assert(!strncmp(buf, "Hello World!\n", 13)); -// } - -// for (i = 0; i < NR_ASYNC_REQ; i++) -// delete ch[i]; -// } - -// static void test_basic_sync(void) -// { -// bool async = false; -// const char *buf; -// CHNet *ch; -// int ret; - -// ch = new CHNet; -// ch->SetURL("http://127.0.0.1:8000/index.php?action=hello"); -// ch->Start(async); -// ch->Read(4096, async); -// ret = ch->read_ret(); -// buf = ch->buffer(); - -// assert(ret == 13); -// assert(!strncmp(buf, "Hello World!\n", 13)); -// delete ch; -// } - -static int test_url_not_set(void) -{ - // CHNet *ch = new CHNet; - - // assert(ch->Start() == -EINVAL); - // assert(!strcmp(ch->GetErrorStr(), "URL is not set")); - // delete ch; - return 0; -} - -static int test_basic(void) -{ - CHNet *ch = new CHNet; - int ret; - - ch->SetURL("http://127.0.0.1:8000/index.php?action=hello"); - ret = ch->Start(); - assert(!ret); - sleep(100); - delete ch; - return 0; -} - -int main(void) -{ - int ret = 0; - - chnet_global_init(); - ret |= test_basic(); - ret |= test_url_not_set(); - // test_basic_sync(); - // test_basic_async(); - chnet_global_stop(); - return ret; -} -- Ammar Faizi