Saturday, May 19, 2012

ParaSoft C++Test --help


C++test Version 6.7.7.2 (Jan 16 2007)

Copyright (C) 1998-2007 by ParaSoft Corporation

usage: cpptest [cpptest_options] [compiler_options] file...

cpptest_options:

-Zicpf , --Zinput_cpf_project

file: C++test project for testing

(ignores all additional files and

options)

-Zocpf , --Zoutput_cpf_project

file: output C++test project

-Zdsp , --Zdsp_project file: DSP/DSW project file for

testing (ignores all additional

files and options)

-Zvcproj , --Zvcproj_project file: VC++ .NET project file for

testing (ignores all additional

files and options)

-Zdc , --Zdsp_config name: name of active configuration

for specified DSP/VCPROJ file

-Zgpj , --Zghs_project file: GHS project file for

testing (ignores all additional

files and options)

-Zmcl , --Zmake_command_line

param: command line to be used to

extract files and options,

compiler/linker executables should be

replaced with ${CPPTEST_SCAN} variable

(ie: "make CXX=\${CPPTEST_SCAN} all");

creates a new project based on

extracted files and options;

-Ztf , --Ztest_file name: file or test unit name

to test

-Zeh , --Zexport_harness name: file or test unit name

to export harness for, if empty

then harness is exported for

all files from the project

-Zrl , --Zread_logs name: file or test unit name

to read logs for, if empty

then logs are read for

all files from the project

-Ztc , --Ztest_config name: test configuration

to be used for current run

-Zpc , --Zproject_config name: project configuration

to be used in current project

-Zso , --Zsave_options file: C++test project;

adds the source file(s) and options

specified in the command-line

to the project;

creates the project if it does not

exist,else updates the existing one

-Zitc , --Zimport_test_cases

allows specifying external test

cases file to use during unit

testing

file: test cases file or location

where .tcr files are stored

-Zito , --Zimport_test_objects

allows specifying external test

objects file to use during unit

testing

file: test objects file or location

where .tor files are stored

-Zis , --Zimport_suppressions

import Coding Standards

Suppressions into project,

file: suppressions file

-Zrf , --Zreport_file file: file for test result output

-Zgh , --Zgenerate_html name: template file name for HTML

report generation

-Zhrd

, --Zhtml_report_directory

dir: location of HTML report

-Zgx, --Zgenerate_xml generate XML report

-Zxrd
, --Zxml_report_directory

dir: location of XML report

-Zpr, --Zpublish_results publish Coding Standards results

on TCM

-Zf, --Zforce force output project overwriting

if exist

-Zow {on
off}, --Zoverwrite {on
off} turning on/off report_file over-

writing (default is on)

-Zoe [quiet], --Zonly_errors [quiet] report only errors

(quiet - suppresses success

message on no errors/violations)

-Zq, --Zquiet do not generate test results

-Zvm, --Zverbosity_mode level: verbosity level 0 - 2

(0 disables verbose messages)

(default is 0)

-Zgrs {on
off}, --Zgrs {on
off} enable/disable GRS reporting

-Zga , --Zgrs_attribute allows specifying GRS attribute

name: must have form key=value

-Zcs, --Zcompile_source compile original user source

-Zrs, --Zreread_symbols enforce symbols re-reading

(for Unit Testing only)

-Zlc , --Zlist_config lists available configurations

param: PROJECT, TEST, HTML

-Zecf, --Zexpand_command_files Expand all options contained in

supplied command files

(aka response files)

into the command line.

This option is recommended

with -Zso.

-Znt --Zno_tests do not perform any tests

-h, --help this help

-V, --version version information

Tuesday, April 17, 2012

google tricks





site:google.com fox will find all sites containing the
word fox , located within the  *.google.com  domain

intitle:fox fire  will find all sites with the word  fox  in the
title and  fire in the text

allintitle:fox fire  will find all sites with the words fox 
and  fire in the title, so it's equivalent to  intitle:fox
intitle:fire

inurl:fox fire  will find all sites containing the word  fire
in the text and  fox  in the URL

allinurl:fox fire will find all sites with the words fox 
and  fire in the URL, so it's equivalent to  inurl:fox
inurl:fire

filetype:pdf fire will return PDFs containing the word
fire, while  filetype:xls  fox will return  Excel spreadsheets
with the word fox

numrange:1-100 fire  will return sites containing a number
from 1 to 100 and the word  fire. The same result can be
achieved with 1..100 fire

link:www.google.com will return documents containing
one or more links to www.google.com

inanchor:fire will return documents with links whose
description contains the word fire (that's the actual link
text, not the URL indicated by the link)


allintext:"fire fox" will return documents which con -tain the phrase  fire fox in their text only

+fire will order results by the number of occurrences of
the word fire

-fire will return documents that don't contain the word
fire

"fire fox" will return documents containing the phrase
fire fox

fire.fox will return documents containing the phrases
fire fox,  fireAfox,  fire1fox,  fire-fox etc.

fire * fox will return documents containing the phrases
fire the fox , fire in fox ,  fire or fox etc.

"fire fox" | firefox  will return documents containing the
phrase fire fox or the word  firefox

Sunday, April 15, 2012

non-blocking tcp socket





Enable/Disable Non-Blocking Mode
Once a socket has been created using the socket() call, it may be set to non-blocking as follows:
    #include "sys/ioctl.h"
    int on =1;
    int off =0;

    //Enable non-blocking
    ioctl (mySocket, FIONBIO, &(on));
    //Disable non-blocking
    ioctl (mySocket, FIONBIO, (char *) &(off));
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
...
...
FD_ZERO(&read_mask);
FD_ZERO(&write_mask);
FD_SET(accept_socket, &read_mask);
FD_SET(accept_socket, &write_mask);
/* handle receiving the packet */
select_return = select(accept_socket, &read_mask, (fd_set *)0, (fd_set *)0, &tv);
if(select_return < 0) /* [timeout=0, -1= ERROR] is returned */
{
    printf("recv: select functions returned -1 error value\n");
}
else if(select_return == 0)
{
    printf("recv: select functions returned 0 timeout value\n");
}
else
{
    printf("recv: select functions returned a positive value\n");
     
    if(FD_ISSET(accept_socket, &read_mask))
    {
        /*  HAND SHAKE AS A START */
        rcv_len = recv(accept_socket, myDmsg, MSG_SIZE, 0);
                 
        if( rcv_len < 0)
        {
            strcpy(myDmsg, "Nothing received");
            isConnected = FALSE;
        }
        else if(rcv_len >= 0)
        {
            strcpy(myDmsg, "Received something2...");
        }
    }
}
/* handle sending the packet */
select_return = select(accept_socket+1, (fd_set *)0, &write_mask, (fd_set *)0, &tv);
if(select_return < 0) /* [timeout=0, -1= ERROR] is returned */
{
    printf("send: select functions returned -1 error value\n");
}
else if(select_return == 0)
{
    printf("send: select functions returned 0 timeout value\n");
}
else
{
    printf("send: select functions returned a positive value\n");
             
    if( send(accept_socket, myDmsg, strlen(myDmsg), 0) < 0)
    {
        /* an error occurred. Handle it appropriately (TODO) */
    }
}
...
...
...


tutorials: 0 1

Labels