/* -*-objc-*- */

/* 
  $Header$
  $Author: dglattin $
  $Date$
  $Log$
 */

#include  <assert.h>
#include  <stdlib.h>
#include  <strings.h>
#include  <SubClass2.h>

#define THE_MESSAGE "Another test message"


@implementation SubClass2


+ initialize {

  printf( "If you see this message then SubClass2 received a"
    " +initialize method\n" );
  
  return self;
}


+ newOther {

  self = [ self new ];

  return self;
}

- hokeyMethod {


  return self;
}


- print {


  printf( "SubClass2 print\n" );
  
  return self;
}


- print:( const char* )aPhrase {


  printf( "SubClass2 print:%s\n", aPhrase );
  
  return self;
}


- print:( const char* )msg1 with:( const char* )msg2 {


  printf( "SubClass2 print:with:, msg1=%s, msg2=%s\n", msg1, msg2 );
  
  return self;
}


- storeOn:( int )aFd {

  int len;
  
  
  [ super storeOn:aFd ];
  sprintf (dumb, THE_MESSAGE);
  len = write (aFd, dumb, sizeof (dumb));
  assert(len == sizeof (dumb));
  
  return self;
}


- readFrom:( int )aFd {

  int len;
  
  
  [ super readFrom:aFd ];
  len = read (aFd, dumb, sizeof (dumb));
  assert(len == sizeof (dumb));
  assert(!strcmp ( dumb, THE_MESSAGE));
  
  return self;
}


@end