[newfield_revision Patch] FieldOffset.cpp: New Test

Jeffrey Oldham oldham at codesourcery.com
Wed Aug 15 23:15:14 UTC 2001


This is Stephen Smith's patch to the FieldOffset test program
demonstrating to a skeptical me that one can assign to a field shifted
by a FieldOffset.

2001-08-15  Stephen Smith  <stephens at proximation.com>

	* FieldOffset.cpp (main): Add assignment to shifted field.

Tested on	sequential Linux using gcc 3.0.1 by compiling and running
Approved by	Jeffreyy D. Oldham
Applied to	newfield_revision branch

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: FieldOffset.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/tests/Attic/FieldOffset.cpp,v
retrieving revision 1.1.2.4
diff -c -p -r1.1.2.4 FieldOffset.cpp
*** FieldOffset.cpp	2001/08/10 17:40:53	1.1.2.4
--- FieldOffset.cpp	2001/08/15 22:08:28
*************** int main(int argc, char *argv[])
*** 139,144 ****
--- 139,152 ----
    tester.out() << "f" << std::endl << f << std::endl;
    tester.out() << "fS" << std::endl << fS << std::endl;
  
+   f(upperXEdge, cell) = fS;
+ 
+   // FIXME: Direct assignment to elements should probably work.
+   // The following line fails.
+   //  f(upperXEdge, cell)(1, 1) = 4.5;
+ 
+   tester.out() << "f" << std::endl << f << std::endl;
+ 
    int ret = tester.results("FieldOffset");
    Pooma::finalize();
    return ret; 


More information about the pooma-dev mailing list