mirror of
https://github.com/labwc/labwc.git
synced 2026-02-20 01:40:22 -05:00
Add tests/t1000-rcxml-simple-parse.c
This commit is contained in:
parent
91ce33dd0d
commit
40c0b169ef
5 changed files with 142 additions and 0 deletions
36
tests/t1000-rcxml-simple-parse.c
Normal file
36
tests/t1000-rcxml-simple-parse.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "rcxml.h"
|
||||
#include "tap.h"
|
||||
|
||||
struct rcxml rc = { 0 };
|
||||
|
||||
static char src[] =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<openbox_config>\n"
|
||||
"<lab>\n"
|
||||
" <csd>yes</csd>\n"
|
||||
"</lab>\n"
|
||||
"</openbox_config>\n";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
plan(1);
|
||||
|
||||
char template[] = "temp_file_XXXXXX";
|
||||
int fd = mkstemp(template);
|
||||
if (fd < 0)
|
||||
exit(1);
|
||||
write(fd, src, sizeof(src) - 1);
|
||||
|
||||
rcxml_init(&rc);
|
||||
rcxml_read(template);
|
||||
unlink(template);
|
||||
|
||||
diag("Simple parse rc.xml");
|
||||
ok1(rc.client_side_decorations);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue