TestPBF.h
上传用户:xfwatch
上传日期:2020-12-14
资源大小:872k
文件大小:2k
源码类别:

中间件编程

开发平台:

Java

  1. /*
  2.  * JBoss, Home of Professional Open Source
  3.  * Copyright 2008, Red Hat, Inc., and others contributors as indicated
  4.  * by the @authors tag. All rights reserved.
  5.  * See the copyright.txt in the distribution for a
  6.  * full listing of individual contributors.
  7.  * This copyrighted material is made available to anyone wishing to use,
  8.  * modify, copy, or redistribute it subject to the terms and conditions
  9.  * of the GNU Lesser General Public License, v. 2.1.
  10.  * This program is distributed in the hope that it will be useful, but WITHOUT A
  11.  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  12.  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  13.  * You should have received a copy of the GNU Lesser General Public License,
  14.  * v.2.1 along with this distribution; if not, write to the Free Software
  15.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  16.  * MA  02110-1301, USA.
  17.  */
  18. #ifndef TestPBF_H
  19. #define TestPBF_H
  20. #include <cppunit/extensions/HelperMacros.h>
  21. #include <cppunit/TestFixture.h>
  22. #include "BaseServerTest.h"
  23. struct acct_info_t {
  24. long acct_no; // 8
  25. char name[50]; // 50
  26. char address[100]; // 100
  27. float foo[2]; // 4 * 2
  28. double balances[2]; // 8 * 2
  29. };
  30. typedef struct acct_info_t ACCT_INFO;
  31. class TestPBF: public BaseServerTest {
  32. CPPUNIT_TEST_SUITE( TestPBF);
  33. CPPUNIT_TEST( test_tpalloc);
  34. CPPUNIT_TEST( test_tpalloc_nonzero);
  35. CPPUNIT_TEST( test_tpalloc_subtype_required);
  36. CPPUNIT_TEST( test_tprealloc);
  37. CPPUNIT_TEST( test_tptypes);
  38. CPPUNIT_TEST( test_tpfree);
  39. CPPUNIT_TEST( test_tpcall);CPPUNIT_TEST_SUITE_END();
  40. public:
  41. void test_tpalloc();
  42. void test_tpalloc_nonzero();
  43. void test_tpalloc_subtype_required();
  44. void test_tpalloc_wrong_subtype();
  45. void test_tprealloc();
  46. void test_tptypes();
  47. void test_tpfree();
  48. void test_tpcall();
  49. virtual void setUp();
  50. virtual void tearDown();
  51. private:
  52. char *m_allocated, *sendbuf, *rcvbuf;
  53. };
  54. #endif