summaryrefslogtreecommitdiffstats
path: root/ast/ast_tester/testobject.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-09 19:26:44 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-09 19:26:44 (GMT)
commit1332d38f2805d986ea130e43218c0d2e870b4dc1 (patch)
treeaa72853cb8d0d8fcd53a6f5eddf196a374226706 /ast/ast_tester/testobject.c
parent5e545ec8058cc5238dc870468b34b5d4617f307f (diff)
downloadblt-1332d38f2805d986ea130e43218c0d2e870b4dc1.zip
blt-1332d38f2805d986ea130e43218c0d2e870b4dc1.tar.gz
blt-1332d38f2805d986ea130e43218c0d2e870b4dc1.tar.bz2
update ast 8.6.2
Diffstat (limited to 'ast/ast_tester/testobject.c')
-rw-r--r--ast/ast_tester/testobject.c120
1 files changed, 0 insertions, 120 deletions
diff --git a/ast/ast_tester/testobject.c b/ast/ast_tester/testobject.c
deleted file mode 100644
index c1c1972..0000000
--- a/ast/ast_tester/testobject.c
+++ /dev/null
@@ -1,120 +0,0 @@
-#include "ast.h"
-#include <stdio.h>
-#include <string.h>
-
-int main(){
- const char *routine;
- const char *file;
- int i;
- int line;
- char *pickle1;
- char *pickle2;
- AstSkyFrame *sf = astSkyFrame( " " );
- AstFrame *bf = astFrame( 2, "Domain=SKY" );
- AstFrameSet *fs = astConvert( bf, sf, " " );
- AstKeyMap *km;
- void *p;
-
- if( fs ) {
- pickle1 = astToString( fs );
- AstFrameSet *fs2 = astFromString( pickle1 );
- pickle2 = astToString( fs2 );
- if( pickle1 && pickle2 ) {
- if( strcmp( pickle1, pickle2 ) && astOK ) {
- astError( AST__INTER, "Error 1\n" );
- }
- } else if( astOK ) {
- astError( AST__INTER, "Error 2\n" );
- }
-
-
- pickle1 = astFree( pickle1 );
- pickle2 = astFree( pickle2 );
-
- if( fs2 && !astEqual( fs, fs2 ) && astOK ) {
- astError( AST__INTER, "Error 3\n" );
- }
-
- astCreatedAt( bf, &routine, &file, &line );
- if( ( !routine || strcmp( routine, "main" ) ) && astOK ) {
- astError( AST__INTER, "Error 31\n" );
- }
- if( ( !file || strcmp( file, "testobject.c" ) ) && astOK ) {
- astError( AST__INTER, "Error 32\n" );
- }
- if( line != 13 && astOK ) {
- astError( AST__INTER, "Error 33 (line is %d)\n", line );
- }
-
-
- km = astActiveObjects( NULL, 0, 0 );
- if( !km && astOK ) {
- astError( AST__INTER, "Error 34\n" );
- } else {
- int nkey = astMapSize( km );
- if( nkey != 3 && astOK ) {
- astError( AST__INTER, "Error 35 (nkey is %d)\n", nkey );
- }
-
- astSetC( km, "SortBy", "KeyUp" );
- for( i=0; i < 3; i++ ){
- const char *key = astMapKey( km, i );
- if( i == 0 ) {
- if( strcmp( key, "Frame" ) && astOK ) {
- astError( AST__INTER, "Error 36 (key 0 is '%s')\n", key );
- } else if( astMapLength(km,key) != 1 && astOK ) {
- astError( AST__INTER, "Error 361 (%d)\n", astMapLength(km,key) );
- } else if( ( !astMapGetElemP( km, key, 0, &p ) || ( p != bf ) ) && astOK ) {
- astError( AST__INTER, "Error 362\n" );
- } else {
- astCreatedAt( p, &routine, &file, &line );
- if( ( !routine || strcmp( routine, "main" ) ) && astOK ) {
- astError( AST__INTER, "Error 363\n" );
- }
- if( ( !file || strcmp( file, "testobject.c" ) ) && astOK ) {
- astError( AST__INTER, "Error 364\n" );
- }
- if( line != 13 && astOK ) {
- astError( AST__INTER, "Error 365 (line is %d)\n", line );
- }
- }
- } else if( i == 1 ) {
- if( strcmp( key, "FrameSet" ) && astOK ) {
- astError( AST__INTER, "Error 37 (key 1 is '%s')\n", key );
- } else if( astMapLength(km,key) != 2 && astOK ) {
- astError( AST__INTER, "Error 371 (%d)\n", astMapLength(km,key) );
- } else if( ( !astMapGetElemP( km, key, 1, &p ) || ( p != fs2 ) ) && astOK ) {
- astError( AST__INTER, "Error 372\n" );
- } else {
- astCreatedAt( p, &routine, &file, &line );
- if( ( !routine || strcmp( routine, "main" ) ) && astOK ) {
- astError( AST__INTER, "Error 373\n" );
- }
- if( ( !file || strcmp( file, "testobject.c" ) ) && astOK ) {
- astError( AST__INTER, "Error 374\n" );
- }
- if( line != 20 && astOK ) {
- astError( AST__INTER, "Error 375 (line is %d)\n", line );
- }
- }
- } else {
- if( strcmp( key, "SkyFrame" ) && astOK ) {
- astError( AST__INTER, "Error 38 (key 2 is '%s')\n", key );
- } else if( astMapLength(km,key) != 1 && astOK ) {
- astError( AST__INTER, "Error 381 (%d)\n", astMapLength(km,key) );
- }
- }
- }
- }
- km = astAnnul( km );
-
- } else if( astOK ){
- astError( AST__INTER, "Error 4\n" );
- }
-
- if( astOK ) {
- printf(" All Object tests passed\n");
- } else {
- printf("Object tests failed\n");
- }
-}