| 1 |
/// \file |
| 2 |
/// \brief test case that \p gvplugin_list returns full plugin names |
| 3 |
/// |
| 4 |
/// See https://gitlab.com/graphviz/graphviz/-/issues/2375. |
| 5 |
|
| 6 |
#include <assert.h> |
| 7 |
#include <graphviz/gvc.h> |
| 8 |
#include <stddef.h> |
| 9 |
#include <stdio.h> |
| 10 |
#include <string.h> |
| 11 |
|
| 12 |
// this is technically not an API function, but the macOS Graphviz.app calls it |
| 13 |
extern char *gvplugin_list(GVC_t *gvc, api_t api, const char *str); |
| 14 |
|
| 15 |
int main(void) { |
| 16 |
|
| 17 |
// setup a Graphviz context |
| 18 |
GVC_t *gvc = gvContext(); |
| 19 |
|
| 20 |
// ask what plugins we have |
| 21 |
char *plugins = gvplugin_list(gvc, API_device, ":"); |
| 22 |
|
| 23 |
// display the result for anyone debugging this test failing |
| 24 |
printf("gvplugin_list(…, \":\") returned: %s\n", plugins); |
| 25 |
|
| 26 |
// check we got full names, not :-truncated names |
| 27 |
assert(strchr(plugins, ':') != NULL && "plugin list not full names"); |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |