add remaining tests to testAll
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
./testBaseException.sh || exit $?
|
||||
./testPVType.sh || exit $?
|
||||
./testThread.sh || exit $?
|
||||
./testLinkedList.sh || exit $?
|
||||
./testBitSet.sh || exit $?
|
||||
./testByteBuffer.sh || exit $?
|
||||
./testIntrospect.sh || exit $?
|
||||
./testPVData.sh || exit $?
|
||||
./testPVStructureArray.sh || exit $?
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
testBaseException...
|
||||
|
||||
all is OK
|
||||
at ../testBaseException.cpp:48
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
|
||||
|
||||
|
||||
|
||||
exception 2
|
||||
at ../testBaseException.cpp:57
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
exception 1
|
||||
at ../testBaseException.cpp:40
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
the root cause
|
||||
at ../testBaseException.cpp:31
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
|
||||
|
||||
PASSED
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
testPVType.sh
|
||||
@@ -0,0 +1,37 @@
|
||||
testBaseException...
|
||||
|
||||
all is OK
|
||||
at ../testBaseException.cpp:48
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
|
||||
|
||||
|
||||
|
||||
exception 2
|
||||
at ../testBaseException.cpp:57
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
exception 1
|
||||
at ../testBaseException.cpp:40
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
the root cause
|
||||
at ../testBaseException.cpp:31
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
../bin/linux-x86/testBaseException
|
||||
/lib/libc.so.6: __libc_start_main()+0xe6
|
||||
../bin/linux-x86/testBaseException
|
||||
|
||||
|
||||
PASSED
|
||||
@@ -0,0 +1,3 @@
|
||||
testGetSetClearFlip... PASSED
|
||||
testOperators... PASSED
|
||||
bitSet: totalConstruct 4 totalDestruct 4
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
testPVType.sh
|
||||
@@ -0,0 +1,3 @@
|
||||
testGetSetClearFlip... PASSED
|
||||
testOperators... PASSED
|
||||
bitSet: totalConstruct 4 totalDestruct 4
|
||||
@@ -0,0 +1,5 @@
|
||||
Basic operation tests...
|
||||
First 10 characters of destination: >> cdefgh <<
|
||||
!!! PASSED
|
||||
Testing inverse endianness...
|
||||
!!! PASSED
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
testPVType.sh
|
||||
@@ -0,0 +1,5 @@
|
||||
Basic operation tests...
|
||||
First 10 characters of destination: >> cdefgh <<
|
||||
!!! PASSED
|
||||
Testing inverse endianness...
|
||||
!!! PASSED
|
||||
@@ -41,13 +41,13 @@ void internalTestBaseException(int unused = 0)
|
||||
}
|
||||
}
|
||||
|
||||
void testBaseException() {
|
||||
printf("testBaseException... ");
|
||||
void testBaseException(FILE *fp) {
|
||||
fprintf(fp,"testBaseException... ");
|
||||
|
||||
try {
|
||||
THROW_BASE_EXCEPTION("all is OK");
|
||||
} catch (BaseException& be) {
|
||||
printf("\n\n%s\n\n", be.what());
|
||||
fprintf(fp,"\n\n%s\n\n", be.what());
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -57,15 +57,21 @@ void testBaseException() {
|
||||
THROW_BASE_EXCEPTION_CAUSE("exception 2", be2);
|
||||
}
|
||||
} catch (BaseException& be) {
|
||||
printf("\n\n%s\n\n", be.what());
|
||||
fprintf(fp,"\n\n%s\n\n", be.what());
|
||||
}
|
||||
|
||||
printf("PASSED\n");
|
||||
fprintf(fp,"PASSED\n");
|
||||
}
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
testBaseException();
|
||||
FILE *fp=NULL;
|
||||
if(argc>1){
|
||||
fp=fopen(argv[1], "w");
|
||||
if(!fp) fprintf(stderr,"Failed to open test output file\n");
|
||||
}
|
||||
if(!fp) fp=stdout;
|
||||
testBaseException(fp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
using namespace epics::pvData;
|
||||
|
||||
void testGetSetClearFlip() {
|
||||
printf("testGetSetClearFlip... ");
|
||||
void testGetSetClearFlip(FILE *fd) {
|
||||
fprintf(fd,"testGetSetClearFlip... ");
|
||||
|
||||
// empty
|
||||
BitSet* b1 = new BitSet();
|
||||
@@ -75,12 +75,12 @@ void testGetSetClearFlip() {
|
||||
assert(str == "{}");
|
||||
|
||||
delete b1;
|
||||
printf("PASSED\n");
|
||||
fprintf(fd,"PASSED\n");
|
||||
|
||||
}
|
||||
|
||||
void testOperators() {
|
||||
printf("testOperators... ");
|
||||
void testOperators(FILE *fd) {
|
||||
fprintf(fd,"testOperators... ");
|
||||
|
||||
BitSet b1;
|
||||
assert(b1 == b1);
|
||||
@@ -135,7 +135,7 @@ void testOperators() {
|
||||
str.clear(); b1.toString(&str);
|
||||
assert(str == "{2, 128}");
|
||||
|
||||
printf("PASSED\n");
|
||||
fprintf(fd,"PASSED\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ int main(int argc,char *argv[])
|
||||
if(fileName!=0 && fileName[0]!=0) {
|
||||
fd = fopen(fileName,"w+");
|
||||
}
|
||||
testGetSetClearFlip();
|
||||
testOperators();
|
||||
testGetSetClearFlip(fd);
|
||||
testOperators(fd);
|
||||
epicsExitCallAtExits();
|
||||
CDRMonitor::get().show(fd);
|
||||
return(0);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
|
||||
#include <epicsAssert.h>
|
||||
@@ -20,10 +21,9 @@
|
||||
#include "pvIntrospect.h"
|
||||
|
||||
using namespace epics::pvData;
|
||||
using std::cout;
|
||||
|
||||
void testBasicOperations() {
|
||||
cout<<"Basic operation tests...\n";
|
||||
void testBasicOperations(std::ostream& ofile) {
|
||||
ofile<<"Basic operation tests...\n";
|
||||
|
||||
ByteBuffer* buff = new ByteBuffer();
|
||||
assert(buff->getSize()==32);
|
||||
@@ -173,15 +173,15 @@ void testBasicOperations() {
|
||||
assert(buff->getPosition()==6);
|
||||
assert(strncmp(&src[2],&dst[2],6)==0);
|
||||
|
||||
cout<<" First 10 characters of destination: >>"<<String(dst, 10)<<"<<\n";
|
||||
ofile<<" First 10 characters of destination: >>"<<String(dst, 10)<<"<<\n";
|
||||
|
||||
delete buff;
|
||||
|
||||
cout<<"!!! PASSED\n";
|
||||
ofile<<"!!! PASSED\n";
|
||||
}
|
||||
|
||||
void testInverseEndianness() {
|
||||
cout<<"Testing inverse endianness...\n";
|
||||
void testInverseEndianness(std::ostream& ofile) {
|
||||
ofile<<"Testing inverse endianness...\n";
|
||||
|
||||
#if EPICS_BYTE_ORDER==EPICS_ENDIAN_BIG
|
||||
ByteBuffer* buff = new ByteBuffer(32,EPICS_ENDIAN_LITTLE);
|
||||
@@ -204,11 +204,22 @@ void testInverseEndianness() {
|
||||
assert(buff->getInt()==0x0A0B0C0D);
|
||||
|
||||
delete buff;
|
||||
cout<<"!!! PASSED\n";
|
||||
ofile<<"!!! PASSED\n";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
testBasicOperations();
|
||||
testInverseEndianness();
|
||||
std::ofstream outfile;
|
||||
std::ostream *out=NULL;
|
||||
if(argc>1) {
|
||||
outfile.open(argv[1]);
|
||||
if(outfile.is_open()){
|
||||
out=&outfile;
|
||||
}else{
|
||||
fprintf(stderr, "Failed to open test output file\n");
|
||||
}
|
||||
}
|
||||
if(!out) out=&std::cout;
|
||||
testBasicOperations(*out);
|
||||
testInverseEndianness(*out);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user