-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test program testapi_modern.c (#7760)
* Add test program testapi_modern.c This makes sure the issue #4518 is preserved. The test fails for now (well we need to add an actual testing of the output) but this lets us play in the debugger. * Add test and PS file in DVC The C code will make a plot to be compared with the CLI expected plot.
- Loading branch information
1 parent
30661f2
commit d60a484
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Issue from GitHub: https://github.com/GenericMappingTools/gmt/issues/4518 | ||
* Problem seems to be that gmt begin comes after GMT_Create_Session in the | ||
* code so there are orientation and page size issues. In gmt end, the | ||
* psconvert call is missing the -A. | ||
* | ||
* See test script api/apimodern.sh | ||
*/ | ||
|
||
#include "gmt.h" | ||
|
||
int main () { | ||
void *API = NULL; | ||
|
||
/* Initialize the GMT session */ | ||
if ((API = GMT_Create_Session ("testapi_modern", 2, GMT_SESSION_RUNMODE, NULL)) == NULL) | ||
return EXIT_FAILURE; | ||
GMT_Call_Module(API, "begin", GMT_MODULE_CMD, "apimodern ps"); | ||
GMT_Call_Module(API, "basemap", GMT_MODULE_CMD, "-BWESN -Bafg -JM7.27/42.27/16.25c -R5.5/41.425/9.0/43.1+r"); | ||
GMT_Call_Module(API, "end", GMT_MODULE_CMD, "show"); | ||
/* Destroy session */ | ||
if (GMT_Destroy_Session (API)) | ||
return EXIT_FAILURE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Purpose: This is a CLI version of what testapi_modern.c should produce | ||
# Fails until we fix the page size and orientation from the C program. | ||
|
||
# This is the fixed baseline DVC plot we will compare with | ||
#gmt begin apimodern ps | ||
# gmt set PS_MEDIA letter | ||
# gmt basemap -BWESN -Bafg -JM7.27/42.27/16.25c -R5.5/41.425/9.0/43.1+r | ||
#gmt end show | ||
|
||
# Run the C code to produce apimodern.ps | ||
testapi_modern | ||
ps=apimodern.ps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
outs: | ||
- md5: b985dda50abc7f6dcceb4a8848e0a83a.dir | ||
size: 3041741 | ||
nfiles: 16 | ||
- md5: b02bb074d97d27aaec4f9d515ebfdc00.dir | ||
size: 3066737 | ||
nfiles: 17 | ||
path: api |