mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
ebb9c7ae04
This makes it possible to skip the call to unit_stop() in such cases. Also use Curl_safefree() in unit test 1302 so it will pass the memory torture test.
37 lines
904 B
C
37 lines
904 B
C
#include <stdlib.h>
|
|
#include "curl_config.h"
|
|
#include "setup.h"
|
|
|
|
#include "strequal.h"
|
|
#include "curlcheck.h"
|
|
|
|
static CURLcode unit_setup( void ) {return CURLE_OK;}
|
|
static void unit_stop( void ) {}
|
|
|
|
UNITTEST_START
|
|
|
|
int rc;
|
|
|
|
rc = curl_strequal("iii", "III");
|
|
fail_unless( rc != 0 , "return code should be zero" );
|
|
|
|
rc = curl_strequal("iiia", "III");
|
|
fail_unless( rc == 0 , "return code should be zero" );
|
|
|
|
rc = curl_strequal("iii", "IIIa");
|
|
fail_unless( rc == 0 , "return code should be zero" );
|
|
|
|
rc = curl_strequal("iiiA", "IIIa");
|
|
fail_unless( rc != 0 , "return code should be non-zero" );
|
|
|
|
rc = curl_strnequal("iii", "III", 3);
|
|
fail_unless( rc != 0 , "return code should be non-zero" );
|
|
|
|
rc = curl_strnequal("iiiABC", "IIIcba", 3);
|
|
fail_unless( rc != 0 , "return code should be non-zero" );
|
|
|
|
rc = curl_strnequal("ii", "II", 3);
|
|
fail_unless( rc != 0 , "return code should be non-zero" );
|
|
|
|
UNITTEST_STOP
|