-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
8 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
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
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,36 @@ | ||
// test the very basics are working | ||
// no refresh() or getch() as this requires a terminal and wouldn't work on CI | ||
// without additional measures. | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include <curses.h> | ||
|
||
int main(void){ | ||
WINDOW* w = initscr(); | ||
if(w == NULL){ | ||
fprintf(stderr, "Error initialising ncurses.\n"); | ||
return 77; | ||
} | ||
|
||
int i = noecho(); | ||
if(i == ERR){ | ||
fprintf(stderr, "Error turning off echo.\n"); | ||
return 77; | ||
} | ||
|
||
i = printw("Hello, PDCurses!"); | ||
if(i == ERR){ | ||
fprintf(stderr, "Error printing to screen.\n"); | ||
return 77; | ||
} | ||
|
||
i = endwin(); | ||
if(i == ERR){ | ||
fprintf(stderr, "Error ending ncurses.\n"); | ||
return 77; | ||
} | ||
|
||
return EXIT_SUCCESS; | ||
} |