9d2bb2f0a336f9d5e2f9d67b8a6a4190972f6d48
[gssweb.git] / json_gssapi / test / datamodel / GSSOIDSetTest.cpp
1 /*
2  * Copyright (c) 2014 <copyright holder> <email>
3  *
4  * For license details, see the LICENSE file in the root of this project.
5  *
6  */
7
8 #include "GSSOIDSetTest.h"
9 #include <datamodel/GSSOIDSet.h>
10
11 CPPUNIT_TEST_SUITE_REGISTRATION( GSSOIDSetTest );
12
13 void GSSOIDSetTest::setUp()
14 {
15
16 }
17
18 void GSSOIDSetTest::tearDown()
19 {
20
21 }
22
23 void GSSOIDSetTest::testConstructor()
24 {
25   /* Variables */
26   /* Error checking */
27   /* Setup */
28   /* Main */
29   CPPUNIT_ASSERT_NO_THROW_MESSAGE(
30     "GSSOIDSet constructor without exceptions;",
31     GSSOIDSet subject()
32   );
33   
34   /* Cleanup */
35   /* return */
36   
37 }
38
39 void GSSOIDSetTest::testAddOID()
40 {
41   /* Variables */
42   GSSOIDSet subject;
43   GSSOID    newOID((char *)"{1 3 6 1 5 5 2}");
44   
45   /* Error checking */
46   /* Setup */
47   /* Main */
48   CPPUNIT_ASSERT_NO_THROW_MESSAGE(
49     "Adding an OID to the set without an exception", 
50     subject.addOID(newOID)
51   );
52   
53   CPPUNIT_ASSERT_EQUAL_MESSAGE(
54     "Counter is not incremented after appending an OID to a set",
55     1,
56     (int)(subject.toGss()->count)
57   );
58   
59   /* Cleanup */
60   /* return */
61 }
62
63
64   /* Variables */
65   /* Error checking */
66   /* Setup */
67   /* Main */
68   /* Cleanup */
69   /* return */
70