File: smoke_test.c

package info (click to toggle)
libcsfml 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,240 kB
  • sloc: cpp: 7,741; ansic: 2,616; sh: 805; makefile: 16
file content (29 lines) | stat: -rw-r--r-- 784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <CSFML/Audio.h>
#include <CSFML/Graphics.h>
#include <CSFML/Network.h>
#include <CSFML/OpenGL.h>
#include <CSFML/System.h>
#include <CSFML/Window.h>

int main(void)
{
    // The build test doesn't check any graphics since that would require a
    // display server. We just test some basic Network / System functionality.
    // However when building we can still include the other headers to ensure
    // they compile.

    char buf[16];
    sfIpAddress local_addr;

    // Print local IP
    local_addr = sfIpAddress_getLocalAddress();
    sfIpAddress_toString(local_addr, buf);
    printf("Local IP = %s\n", buf);

    // Call some time functions from sfml-system
    if (sfTime_asMilliseconds(sfSeconds(5)) != 5000)
        return 1;

    return 0;
}