ftp.nice.ch/pub/next/developer/resources/libraries/libcoll.940510.s.tar.gz#/libcoll-940510/checks/test10.m

This is test10.m in view mode; [Download] [Up]

#include <coll/coll.h>
#include <assert.h>

int main()
{
#if ELT_INCLUDES_DOUBLE

  id a = [[Array alloc] initEncoding:@encode(double)];
  elt e;
  double dbl;

  printf("testing elt doubles\n");

  [a addElement:(double)3.14];
  [a addElement:(double)1.41];
  [a addElement:(double)4.15];
  [a addElement:(double)1.59];
  [a addElement:(double)5.92];
  [a addElement:(double)9.26];

  e = [a elementAtIndex:1];
  dbl = [a elementAtIndex:2].double_u;
  printf("dbl = %f\n", dbl);

  [a addElementIfAbsent:(double)9.26];
  assert([a count] == 6);

  [a removeElement:(double)3.14];
  assert([a count] == 5);

#endif /* ELT_INCLUDES_DOUBLE */

  printf("no errors\n");
  exit(0);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.