initial batch of gtest tests

This commit is contained in:
Matej Sekoranja
2011-09-23 15:17:44 +02:00
parent 46970e45ee
commit ba61be3c1c
5 changed files with 147 additions and 202 deletions

View File

@@ -1,29 +1,15 @@
/*
* HexDumpTest.cpp
*
* Created on: Nov 8, 2010
* Author: Miha Vitorovic
*/
#include <gtest/gtest.h>
#include <pv/hexDump.h>
#include <iostream>
using namespace epics::pvData;
using namespace epics::pvAccess;
using std::cout;
using std::endl;
int main(int argc, char *argv[]) {
TEST(hexDumpTest, hexDump)
{
char TO_DUMP[] = "pvAccess dump test\0\1\2\3\4\5\6\254\255\256";
hexDump("test", (int8*)TO_DUMP, 18+9);
hexDump("only text", (int8*)TO_DUMP, 18);
hexDump("22 byte test", (int8*)TO_DUMP, 22);
cout<<endl;
return 0;
EXPECT_NO_THROW(hexDump("test", (int8*)TO_DUMP, 18+9));
EXPECT_NO_THROW(hexDump("only text", (int8*)TO_DUMP, 18));
EXPECT_NO_THROW(hexDump("22 byte test", (int8*)TO_DUMP, 22));
}