* limitations under the License.
*/
+#include <sys/stat.h>
+
#include <winpr/crt.h>
#include <winpr/comm.h>
#include <winpr/file.h>
BOOL success;
LPCSTR lpFileName = "\\\\.\\COM1";
COMMPROP commProp;
+ struct stat statbuf;
hComm = CreateFileA(lpFileName,
GENERIC_READ | GENERIC_WRITE,
return EXIT_FAILURE;
}
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
success = DefineCommDevice(lpFileName, "/dev/ttyS0");
if(!success)
{
#include <stdio.h>
+#include <sys/stat.h>
+
#include <winpr/comm.h>
#include <winpr/crt.h>
int TestControlSettings(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
DCB dcb;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{
*/
#include <stdio.h>
+#include <sys/stat.h>
#include <winpr/comm.h>
#include <winpr/crt.h>
int TestGetCommState(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{
*/
#include <stdio.h>
+#include <sys/stat.h>
#include <termios.h>
#include <winpr/comm.h>
int TestHandflow(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{
*/
#include <stdio.h>
+#include <sys/stat.h>
#include <termios.h>
#include <winpr/comm.h>
int TestSerialChars(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{
*/
#include <stdio.h>
+#include <sys/stat.h>
#include <winpr/comm.h>
#include <winpr/crt.h>
int TestSetCommState(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{
*/
#include <stdio.h>
+#include <sys/stat.h>
#include <termios.h>
#include <winpr/comm.h>
int TestTimeouts(int argc, char* argv[])
{
+ struct stat statbuf;
BOOL result;
HANDLE hComm;
- // TMP: FIXME: check if we can proceed with tests on the actual device, skip and warn otherwise but don't fail
+ if (stat("/dev/ttyS0", &statbuf) < 0)
+ {
+ fprintf(stderr, "/dev/ttyS0 not available, making the test to succeed though\n");
+ return EXIT_SUCCESS;
+ }
+
result = DefineCommDevice("COM1", "/dev/ttyS0");
if (!result)
{