Skip to content

Commit

Permalink
Skip all NSURL* test cases using GSInetServerStream on Windows (#268)
Browse files Browse the repository at this point in the history
* Mark all test cases using GSSocketStream as hopeful on win32

* Update ChangeLog

* Remove allow-test-failures flag
  • Loading branch information
hmelder authored Sep 27, 2022
1 parent 0f9edb1 commit a8c421d
Show file tree
Hide file tree
Showing 16 changed files with 227 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
CXX: g++

- name: Windows MinGW GCC x86_64
allow-test-failures: true
os: windows-2019
arch: x86_64
msystem: MINGW64
Expand All @@ -64,7 +63,6 @@ jobs:
LDFLAGS: -fuse-ld=lld

- name: Windows MSVC Clang gnustep-2.0 x86_64
allow-test-failures: true
os: windows-2019
arch: x64
host: x86_64-pc-windows
Expand Down
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
C99 does not support implicit function declarations. Add string.h
and unistd.h when applicable.

2022-08-23 Hugo Melder <[email protected]>

* Tests/base/NSURL/basic.m:
Fix URL description and resource specifier test value on win32.
* Tests/base/NSURL/test00.m:
* Tests/base/NSURL/test01.m:
* Tests/base/NSURL/test02.m:
* Tests/base/NSURLConnection/test01.m:
* Tests/base/NSURLConnection/test02.m:
* Tests/base/NSURLConnection/test03.m:
* Tests/base/NSURLConnection/test04.m:
* Tests/base/NSURLConnection/test05.m:
* Tests/base/NSURLConnection/test06.m:
* Tests/base/NSURLConnection/test07.m:
* Tests/base/NSURLHandle/test00.m:
* Tests/base/NSURLHandle/test01.m:
Skip all test cases using the GSInetServerStream class as
it is broken on win32.

2022-08-16 Hugo Melder <[email protected]>

* Source/NSPredicate.m:
Expand Down
8 changes: 4 additions & 4 deletions Tests/base/NSURL/basic.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ int main()
str = [url path];
PASS_EQUAL(str, @"C:\\WINDOWS",
"Path of file URL C:\\WINDOWS is C:\\WINDOWS");
PASS_EQUAL([url description], @"file://localhost/C:%5CWINDOWS/",
"File URL C:\\WINDOWS is file://localhost/C:%%5CWINDOWS/");
PASS_EQUAL([url resourceSpecifier], @"//localhost/C:%5CWINDOWS/",
"resourceSpecifier of C:\\WINDOWS is //localhost/C:%%5CWINDOWS/");
PASS_EQUAL([url description], @"file:///C:%5CWINDOWS/",
"File URL C:\\WINDOWS is file:///C:%%5CWINDOWS/");
PASS_EQUAL([url resourceSpecifier], @"/C:%5CWINDOWS/",
"resourceSpecifier of C:\\WINDOWS is /C:%5CWINDOWS/");
#else
url = [NSURL fileURLWithPath: @"/usr"];
str = [url path];
Expand Down
18 changes: 18 additions & 0 deletions Tests/base/NSURL/test00.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ int main()
keepalive = [helpers stringByAppendingPathComponent: @"keepalive"];
respond = [helpers stringByAppendingPathComponent: @"respond"];

/* The following test cases depend on the keepalive and response
* HTTP servers. Both servers use the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

START_SET("-resourceDataUsingCache")
const char *lit = "This is the data in the first chunk\r\n"
"and this is the second one\r\n"
Expand Down Expand Up @@ -209,6 +222,11 @@ int main()
END_SET([name UTF8String])
}
LEAVE_POOL

#if defined(_WIN32)
testHopeful = NO;
#endif

#endif
return 0;
}
18 changes: 18 additions & 0 deletions Tests/base/NSURL/test01.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ int main()
helpers = [helpers stringByAppendingPathComponent: @"obj"];
keepalive = [helpers stringByAppendingPathComponent: @"keepalive"];

/* The following test cases depend on the keepalive
* HTTP server. This server uses the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

START_SET("Keepalive")
url = [NSURL URLWithString: @"http://localhost:4322/"];

Expand Down Expand Up @@ -63,6 +76,11 @@ int main()
END_SET("Keepalive")

LEAVE_POOL

#if defined(_WIN32)
testHopeful = NO;
#endif

#endif
return 0;
}
18 changes: 18 additions & 0 deletions Tests/base/NSURL/test02.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ int main()
helpers = [helpers stringByAppendingPathComponent: @"Helpers"];
helpers = [helpers stringByAppendingPathComponent: @"obj"];
capture = [helpers stringByAppendingPathComponent: @"capture"];

/* The following test cases depend on the capture
* HTTP server. The server uses the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

m = [NSMutableString stringWithCapacity: 2048];
for (i = 0; i < 128; i++)
Expand Down Expand Up @@ -124,6 +137,11 @@ int main()
END_SET("Secure")

LEAVE_POOL

#if defined(_WIN32)
testHopeful = NO;
#endif

#endif
return 0;
}
9 changes: 9 additions & 0 deletions Tests/base/NSURLConnection/basic.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ int main()
"NSURLConnection +connectionWithRequest: delegate: with nil as delegate returns a instance");

response = nil;

#if defined(_WIN32)
testHopeful = YES;
#endif

data = [NSURLConnection sendSynchronousRequest: mutable
returningResponse: &response
error: &error];
Expand All @@ -40,6 +45,10 @@ int main()
PASS(response != nil && [(NSHTTPURLResponse*)response statusCode] > 0,
"NSURLConnection synchronous load returns a response");

#if defined(_WIN32)
testHopeful = NO;
#endif

path = [[NSFileManager defaultManager] currentDirectoryPath];
path = [path stringByAppendingPathComponent: @"basic.m"];
[mutable setURL: [NSURL fileURLWithPath: path]];
Expand Down
16 changes: 16 additions & 0 deletions Tests/base/NSURLConnection/test01.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ int main(int argc, char **argv, char **env)
NSString *urlString;
NSURLRequest *req;
Delegate *del;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

duration = 0.0;
timing = 0.1;
Expand Down Expand Up @@ -93,5 +105,9 @@ int main(int argc, char **argv, char **env)

[arp release]; arp = nil;

#if defined(_WIN32)
testHopeful = NO;
#endif

return 0;
}
17 changes: 16 additions & 1 deletion Tests/base/NSURLConnection/test02.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ int main(int argc, char **argv, char **env)
TestWebServer *server;
NSURLConnectionTest *testCase;
BOOL debug = NO;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

testClass = [bundle principalClass]; // NSURLConnectionTest

Expand Down Expand Up @@ -130,8 +142,11 @@ int main(int argc, char **argv, char **env)
format: @"can't load bundle TestConnection"];
}

#if defined(_WIN32)
testHopeful = NO;
#endif

DESTROY(arp);

return 0;
}
16 changes: 16 additions & 0 deletions Tests/base/NSURLConnection/test03.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ int main(int argc, char **argv, char **env)
NSBundle *bundle;
BOOL loaded;
NSString *helperPath;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

// load the test suite's classes
fm = [NSFileManager defaultManager];
Expand Down Expand Up @@ -142,5 +154,9 @@ int main(int argc, char **argv, char **env)

DESTROY(arp);

#if defined(_WIN32)
testHopeful = NO;
#endif

return 0;
}
15 changes: 15 additions & 0 deletions Tests/base/NSURLConnection/test04.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ int main(int argc, char **argv, char **env)
BOOL loaded;
NSString *helperPath;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

// load the test suite's classes
fm = [NSFileManager defaultManager];
helperPath = [[fm currentDirectoryPath]
Expand Down Expand Up @@ -163,6 +175,9 @@ int main(int argc, char **argv, char **env)
format: @"can't load bundle TestConnection"];
}

#if defined(_WIN32)
testHopeful = NO;
#endif

DESTROY(arp);

Expand Down
15 changes: 15 additions & 0 deletions Tests/base/NSURLConnection/test05.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ int main(int argc, char **argv, char **env)
NSBundle *bundle;
BOOL loaded;
NSString *helperPath;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

// load the test suite's classes
fm = [NSFileManager defaultManager];
Expand Down Expand Up @@ -180,6 +192,9 @@ int main(int argc, char **argv, char **env)
format: @"can't load bundle TestConnection"];
}

#if defined(_WIN32)
testHopeful = NO;
#endif

DESTROY(arp);

Expand Down
15 changes: 15 additions & 0 deletions Tests/base/NSURLConnection/test06.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ int main(int argc, char **argv, char **env)
NSBundle *bundle;
BOOL loaded;
NSString *helperPath;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

// load the test suite's classes
fm = [NSFileManager defaultManager];
Expand Down Expand Up @@ -65,6 +77,9 @@ int main(int argc, char **argv, char **env)
format: @"can't load bundle TestConnection"];
}

#if defined(_WIN32)
testHopeful = NO;
#endif

DESTROY(arp);

Expand Down
15 changes: 15 additions & 0 deletions Tests/base/NSURLConnection/test07.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ int main(int argc, char **argv, char **env)
NSBundle *bundle;
BOOL loaded;
NSString *helperPath;

/* The following test cases depend on the GSInetServerStream
* class which is completely broken on Windows.
*
* See: https://github.com/gnustep/libs-base/issues/266
*
* We will mark the test cases as hopeful on Windows.
*/
#if defined(_WIN32)
NSLog(@"Marking local web server tests as hopeful because GSInetServerStream is broken on Windows");
testHopeful = YES;
#endif

// load the test suite's classes
fm = [NSFileManager defaultManager];
Expand Down Expand Up @@ -97,6 +109,9 @@ int main(int argc, char **argv, char **env)
format: @"can't load bundle TestConnection"];
}

#if defined(_WIN32)
testHopeful = NO;
#endif

DESTROY(arp);

Expand Down
Loading

0 comments on commit a8c421d

Please sign in to comment.