@@ -17,10 +17,10 @@ using namespace TAP;
1717/* Tests for atomic type stamps*/
1818
1919char sample_data_char[] =" Some string" ;
20- short int sample_data_int16[] = {1 , -2 , -3 ,4 ,555 ,66 };
21- int sample_data_int32[] = {10 , -20 , -30 ,40 ,500 ,6 };
22- long long sample_data_int64[] = {100 , -200 , -300 ,400 ,5 ,6 };
23- double sample_data_double[] = {1.4142 ,2 ,3.1415 ,4.2e01 ,5 , 6 ,7 };
20+ short int sample_data_int16[] = {1 , -2 , -3 ,4 ,555 ,66 , 777 , 8 };
21+ int sample_data_int32[] = {10 , -20 , -30 ,40 ,500 ,6 , 77 , 888 };
22+ long long sample_data_int64[] = {100 , -200 , -300 ,400 ,5 ,6 , 7000 , 808 };
23+ double sample_data_double[] = {1.4142 ,2 ,3.1415 ,4.2e01 ,5 , 6 ,7 };
2424
2525int
2626main ()
@@ -30,10 +30,10 @@ main()
3030size_t sample_data_int64_size =sizeof (sample_data_int64);
3131size_t sample_data_double_size =sizeof (double ) *7 ;
3232
33- TEST_START (21 );
33+ TEST_START (29 );
3434
3535/* Check that Bin and Str Char stamps works well*/
36- {/* 1, 2, 3 */
36+ {/* 1..4 */
3737 Blobblob (sample_data_char,strlen (sample_data_char));
3838 StampArithm<char > stamp;
3939 std::vector<char > v = blob.ShiftSingleStampBin (stamp);
@@ -45,10 +45,14 @@ main()
4545
4646char c = stamp.ExtractValue (blob);
4747is (c,' m' ," extract char as value works well" );
48+
49+ sized_ptr<char > sp =stamp.ExtractPValue (blob);
50+ char * p = sp;
51+ is (*p,' e' ," Extract poiner to value works well" );
4852 }
4953
5054/* Check that Bin and Srt Int16 stamps works well*/
51- {/* 4, 5, 6, 7, 8 */
55+ {/* 5..11 */
5256 Blobblob ((char *)sample_data_int16, sample_data_int16_size);
5357 StampArithm<short int > stamp;
5458 std::vector<char > v = blob.ShiftSingleStampBin (stamp);
@@ -68,10 +72,18 @@ main()
6872
6973signed short int si = stamp_signed.ExtractValue (blob);
7074is (si,555 ," Extract signed int16 as value" );
75+
76+ sized_ptr<unsigned short int > usp =stamp_unsigned.ExtractPValue (blob);
77+ unsigned short int * up = usp;
78+ is (*up,66 ," Extract poiner to value for unsigned int16 works well" );
79+
80+ sized_ptr<signed short int > ssp =stamp_signed.ExtractPValue (blob);
81+ signed short int * sp = ssp;
82+ is (*sp,777 ," Extract poiner to value for signed int16 works well" );
7183 }
7284
7385/* Check that Bin and Srt Int32 stamps works well*/
74- {/* 9, 10, 11, 12, 13 */
86+ {/* 12..18 */
7587 Blobblob ((char *)sample_data_int32, sample_data_int32_size);
7688 StampArithm<int > stamp;
7789
@@ -94,11 +106,18 @@ main()
94106signed int si = stamp_signed.ExtractValue (blob);
95107is (si,500 ," Extract signed int32 as value" );
96108
109+ sized_ptr<unsigned int > usp =stamp_unsigned.ExtractPValue (blob);
110+ unsigned int * up = usp;
111+ is (*up,6 ," Extract poiner to value for unsigned int32 works well" );
112+
113+ sized_ptr<signed int > ssp =stamp_signed.ExtractPValue (blob);
114+ signed int * sp = ssp;
115+ is (*sp,77 ," Extract poiner to value for signed int32 works well" );
97116 }
98117
99118
100119/* Check that Bin and Srt Int64 stamps works well*/
101- {/* 14, 15, 16, 17, 18 */
120+ {/* 19..25 */
102121 Blobblob ((char *)sample_data_int64, sample_data_int64_size);
103122 StampArithm<long long > stamp;
104123
@@ -120,10 +139,19 @@ main()
120139
121140signed long long si = stamp_signed.ExtractValue (blob);
122141is (si,5 ," Extract signed int32 as value" );
142+
143+ sized_ptr<unsigned long long > usp =stamp_unsigned.ExtractPValue (blob);
144+ unsigned long long * up = usp;
145+ is (*up,6 ," Extract poiner to value for unsigned int64 works well" );
146+
147+ sized_ptr<signed long long > ssp =stamp_signed.ExtractPValue (blob);
148+ signed long long * sp = ssp;
149+ is (*sp,7000 ," Extract poiner to value for signed int64 works well" );
150+
123151 }
124152
125153/* Test Double stamp*/
126- {/* 19, 20, 21 */
154+ {/* 26..29 */
127155 Blobblob ((char *)sample_data_double, sample_data_double_size);
128156 StampArithm<double > stamp;
129157 std::vector<char > v = blob.ShiftSingleStampBin (stamp);
@@ -135,6 +163,11 @@ main()
135163
136164double d = stamp.ExtractValue (blob);
137165is (d,3.1415 ," Extract double as value" );
166+
167+ sized_ptr<double > sp =stamp.ExtractPValue (blob);
168+ double * p = sp;
169+ is (*p,42 ," Extract poiner to value for double works well" );
170+
138171 }
139172 TEST_END;
140173}